question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect TypeScript errors about a missing css prop

See original GitHub issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
niekertcommented, Sep 9, 2019

I ran into the same issue today while I was working on a package where I was importing components from another package that were created (and typed) as styled() components from @emotion/styled, all on version 10.0.17.

The issue went away after adding a import '@emotion/core' to the index.ts file of my package. I think the problem resided in the fact that the type definitions to support the css prop would otherwise not be properly resolved by TypeScript somehow.

2reactions
Andaristcommented, Oct 27, 2019

Typings are currently getting a serious makeover in https://github.com/emotion-js/emotion/pull/1501 and we plan to rethink how the theme can be typed. Closing this to clear up the issue tracker, but if you are interested in this please follow that PR, give your feedback if necessary and stay tuned for upcoming changes!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending an MUI component gives TS error about "css ...
Here is the error that I get when I use the custom SnackbarContent component: Property 'css' is missing in type '{ type: "error"...
Read more >
TypeScript - Emotion
When using our JSX factory, TypeScript only allows the css prop on components that accept a className prop. This is because @emotion/react resolves...
Read more >
Tooling - styled-components
The webstorm-styled-components plugin adds code completion and highlighting for CSS properties and values in the template strings. And it also provides code ...
Read more >
Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI...
Read more >
TypeScript errors and how to fix them
error TS1117: An object literal cannot have multiple properties with the same name in strict mode. Broken Code ❌. 1 2 3 4...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found