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

@types/react conflict for @types/[email protected] #2167

Closed
dfee opened this issue Dec 10, 2020 · 4 comments
Closed

@types/react conflict for @types/[email protected] #2167

dfee opened this issue Dec 10, 2020 · 4 comments

Comments

@dfee
Copy link

dfee commented Dec 10, 2020

Current behavior:
There's a conflict between @types/react and @emotion/react – likely because @emotion/react is using the @types/[email protected] vs the more recent @types/[email protected]:

ERROR in /Users/dfee/code/.pnpm/@types/[email protected]/node_modules/@types/react/index.d.ts(1341,15):
TS2320: Interface 'HTMLProps<T>' cannot simultaneously extend types 'AllHTMLAttributes<T>' and 'ClassAttributes<T>'.
  Named property 'css' of types 'AllHTMLAttributes<T>' and 'ClassAttributes<T>' are not identical.
ERROR in /Users/dfee/code/.pnpm/@types/[email protected]/node_modules/@types/react/index.d.ts(1346,15):
TS2320: Interface 'SVGProps<T>' cannot simultaneously extend types 'SVGAttributes<T>' and 'ClassAttributes<T>'.
  Named property 'css' of types 'SVGAttributes<T>' and 'ClassAttributes<T>' are not identical.

Environment information:

  • react version: 17.0.1
  • @types/react: 17.0.0
  • @emotion/react version: 11.1.2
@Andarist
Copy link
Member

We do not depend on the exact version of @types/react - we try to cope with whatever you have installed. You have linked to a devDependency range but that is not used when you are using Emotion in your project.


Please always try to share a repro case in a runnable form - either by providing a git repository to clone or a codesandbox. OSS maintainers usually can't afford the time to set up the repro, even if exact steps are given.

@dfee
Copy link
Author

dfee commented Dec 10, 2020

Back to the drawing board. I'm unsure where this is coming from.

Perhaps it's because there was a change from @emotion/core (v10) -> @emotion/react (v11) ... I'm using @storybook/react which has a dep on the former, but my code has the latter?

I'm hoping this is where the conflict is coming from. Hopefully it's solved by this: storybookjs/storybook#13300

@Andarist
Copy link
Member

Andarist commented Dec 10, 2020

There is also this issue with Storybook: storybookjs/storybook#13145 . I believe this should be fixed as well - they shouldn't enforce a single version of Emotion packages like that because they don't control what their users actually use.

That being said - not sure if this is going to resolve your issue anyway. If you provide a repro case I could take a look at it.

@srmagura
Copy link
Contributor

srmagura commented Feb 1, 2022

Closing this stale issue because there doesn't seem to be anything actionable for our team. Seems like the conflict may originate from Storybook rather than Emotion.

@srmagura srmagura closed this as completed Feb 1, 2022
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

3 participants