emotion: @emotion/serialize/types/index.ts TS2411: error

Current behavior:

TypeScript compiler throws numerous errors related to CSSInterpolation:

node_modules/@emotion/serialize/types/index.d.ts:37:18 - error TS2411: Property 'zoom' of type 'Zoom | readonly NonNullable<Zoom | undefined>[] | ("normal" | "reset" | (string & {}) | Globals)[] | undefined' is not assignable to 'string' index type 'CSSInterpolation'.

Found 825 errors in the same file, starting at: node_modules/@emotion/serialize/types/index.d.ts:37

Using TS version 5.3.2

Not sure what changed but suddenly index.d.ts appered under node_modules/@emotion/serialize/types even though we have been using same version 1.1.2 all the time (or actually it’s dependency of react-select)

└─┬ react-select@5.7.2 └─┬ @emotion/react@11.11.1 ├─┬ @emotion/babel-plugin@11.11.0 │ └── @emotion/serialize@1.1.2 deduped └── @emotion/serialize@1.1.2

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 19
  • Comments: 17 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Current behavior:

TypeScript compiler throws numerous errors related to CSSInterpolation:

node_modules/@emotion/serialize/types/index.d.ts:37:18 - error TS2411: Property 'zoom' of type 'Zoom | readonly NonNullable<Zoom | undefined>[] | ("normal" | "reset" | (string & {}) | Globals)[] | undefined' is not assignable to 'string' index type 'CSSInterpolation'.

Found 825 errors in the same file, starting at: node_modules/@emotion/serialize/types/index.d.ts:37

Using TS version 5.3.2

Not sure what changed but suddenly index.d.ts appered under node_modules/@emotion/serialize/types even though we have been using same version 1.1.2 all the time (or actually it’s dependency of react-select)

└─┬ react-select@5.7.2 └─┬ @emotion/react@11.11.1 ├─┬ @emotion/babel-plugin@11.11.0 │ └── @emotion/serialize@1.1.2 deduped └── @emotion/serialize@1.1.2

Having the same issue as well

If anyone is looking for a workaround I used the solution in this comment pinning csstype to 3.1.2 for now. https://github.com/frenic/csstype/issues/189#issuecomment-1853012588

I was experiencing the same issue, and it was resolved by setting the skipLibCheck property to true within the compilerOptions in the tsconfig file.

I have the same issue!

Fixed by #3141

same issue

Same issue here.