Closed amoore108 closed 4 months ago
For some reason, you have multiple versions of @emotion/utils
installed there. Your package manager clinged in one place to what it already had installed before. I'd purge @emotion/utils
entries from ur lockfile and reinstall the project - that should fix the issue.
Thanks, that seemed to be the issue!
Current behavior:
Using Emotion
11.12.0
with TypeScript appears to have introduced a type mismatch with theEmotionCache
type.The
createCache
function returns anEmotionCache
type, which is exported in@emotion/utils
. Its shape is:The
createEmotionServer
function from@emotion/server/create-instance
takes the cache as an argument, but throws a type error:createEmotionServer
is expecting anEmotionCache
type in@emotion/server/node_modules/@emotion/utils
. It has the shape:You can see the
inserted
type is mismatchedTo reproduce:
11.12.0
, along with TypeScriptcreateCache
from@emotion/cache
createEmotionServer
from@emotion/server/create-instance
Expected behavior:
No type errors thrown when passing in a cache into
createEmotionServer
Environment information:
react
version: 18.3.1@emotion/react
version: 11.12.0