Types of property 'css' are incompatible. Type 'InterpolationWithTheme<any>' is not assignable to type 'Interpolation<Theme>'
See original GitHub issueCurrent behavior:
When using css
prop with Next.js, it sometimes yields a warning about Types of property 'css' are incompatible.
. (not always)
I’m confused as to why. For now, I’m // @ts-ignore
all issues manually.
It happens on both svg
elements and css
properties.
Error:(51, 6) TS2322: Type '{ accept?: string; acceptCharset?: string; action?: string; allowFullScreen?: boolean; allowTransparency?: boolean; alt?: string; as?: string; async?: boolean; autoComplete?: string; autoFocus?: boolean; ... 356 more ...; flipModeOptions: { ...; }; }' is not assignable to type '{ css?: Interpolation<Theme>; }'.
Types of property 'css' are incompatible.
Type 'InterpolationWithTheme<any>' is not assignable to type 'Interpolation<Theme>'.
To reproduce:
git clone https://github.com/UnlyEd/next-right-now.git at-update-deps-03-31
cd at-update-deps-03-31 && git checkout at-update-deps-03-31
cp .env.local.example .env.local
- Uses the default ENV variables when running locallyyarn
yarn start
- Open
http://localhost:8888
PR: https://github.com/UnlyEd/next-right-now/pull/304
Expected behavior:
It should’t issue an error.
Environment information:
"@emotion/react": "11.1.5",
"@emotion/styled": "11.1.5",
"react": "17.0.2",
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Developers - Types of property 'css' are incompatible. ...
Types of property 'css' are incompatible. Type 'InterpolationWithTheme ' is not assignable to type 'Interpolation '
Read more >Emotion types are polluting the global scope · Issue #1800
Types of property 'css' are incompatible. Type 'string ... Type 'FlattenInterpolation<ThemeProps<any>>' is not assignable to type ...
Read more >TypeScript issue with styled-component's "css" prop and ...
Type 'readonly SimpleInterpolation[]' is not assignable to type 'ObjectInterpolation<undefined>'. Types of property 'filter' are incompatible.
Read more >TypeScript
These definitions infer types for css properties with the object syntax, ... css({ ^ Argument of type 'boxSizing: 'bordre-box';' is not assignable [....
Read more >importing types from @storybook/react breaks emotion css ...
Type '({ size }: any) => SerializedStyles' is not assignable to type ... because you'll get a Types of property 'css' are incompatible....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This sounds like an issue with Storybook (since it’s still on Emotion 10). Not much that we can do about it here.
Yep, but then you’re creating a (git) patch that is applied there in any next install - eg on CI.
This can be done with
patch-package
tool:https://www.npmjs.com/package/patch-package
Or you can use yarn 2 patch protocol(if you’re using it): https://yarnpkg.com/cli/patch https://yarnpkg.com/cli/patch-commit https://yarnpkg.com/features/protocols#patch