Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type errors in @emotion/cache and @emotion/utils #3218

Open
Methuselah96 opened this issue Jul 21, 2024 · 3 comments
Open

Type errors in @emotion/cache and @emotion/utils #3218

Methuselah96 opened this issue Jul 21, 2024 · 3 comments

Comments

@Methuselah96
Copy link
Contributor

Methuselah96 commented Jul 21, 2024

Current behavior:

There are two new type errors related to missing dependencies that have popped up in the past week:

Error: ./node_modules/@emotion/cache/dist/declarations/types/index.d.ts(4,23): error TS2688: Cannot find type definition file for 'node'.
Error: ./node_modules/@emotion/utils/dist/declarations/src/types.d.ts(1,33): error TS2307: Cannot find module '@emotion/sheet' or its corresponding type declarations.

To reproduce:

  1. Start a TypeScript project with @emotion/react using a strict package manager (e.g., pnpm or Yarn PnP) and with skipLibCheck set to false

Expected behavior:

No type errors

Environment information:

  • react version: 18.3.1
  • @emotion/react version: 11.13.0
@fdw
Copy link

fdw commented Jul 22, 2024

I think this also breaks our types, because @emotion/cache now references @types/node, even though our project runs in the browser and has slightly different types for built-in functions.

@Andarist
Copy link
Member

I'm working on removing the incorrect node references here: #3219

As to the other problem with @emotion/utils depending on @emotion/sheet... I have to think about it a little more. I'll fix this in the coming days.

@StreetStrider
Copy link

@Andarist hello. It looks like an ordinary hoisting problem. I've recently updated some of my emotion-related deps and stumbled upon this. In my case I used public-hoist-pattern[]=@emotion/sheet (pnpm). I think there's missing dependency on types from utils → sheet. Lifting sheet solves the issue for me.

    "@emotion/react":
      "11.13.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants