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

Missing peerDependency "@babel/core@^7.0.0-0" from next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5 #31887

Closed
m1heng opened this issue Nov 28, 2021 · 3 comments
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@m1heng
Copy link

m1heng commented Nov 28, 2021

What version of Next.js are you using?

12.0.4

What version of Node.js are you using?

16.x

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

next dev

Describe the Bug

next > styled-jsx: @babel/plugin-syntax-jsx@7.14.5 requires a peer of @babel/core@^7.0.0-0 but none was installed.

package next requires styled-jsx which has a unversioned optional peerDep @babel/core, but styled-jsx also requires @babel/plugin-syntax-jsx which has a required peerDep @babel/core. And next does not require @babel/core.
This ends up with @babel/plugin-syntax-jsx missed his peerDep @babel/core.

Although it works for now, but with pnpm, it will log warning like above, and I think for sure a clear dependency graph should be maintained.

There are multiple solutions,

  1. next add @babel/core as dependency, and mark @babel/core as required peerDependency in styled-jsx.
  2. next add @babel/core as peerDependency, and let user add @bable/core in their own project.
  3. remove peerDep @babel/core from @babel/plugin-syntax-jsx (I had a look into this package, I am not really sure why did they add @babel/core as its peerDep)

Expected Behavior

Clear dependency.

To Reproduce

No need.

@m1heng m1heng added the bug Issue was opened via the bug report template. label Nov 28, 2021
@timneutkens timneutkens added area: styled-jsx good first issue Easy to fix issues, good for newcomers and removed bug Issue was opened via the bug report template. labels Nov 29, 2021
@rtritto
Copy link

rtritto commented Nov 29, 2021

Related vercel/styled-jsx#736

kodiakhq bot pushed a commit that referenced this issue Jan 17, 2022
This ncc's some remaining dependencies bringing us under 20 install time dependencies (including nested dependencies), this also reduces install size by another `2.75 MB`. A follow-up PR will investigate a custom install script for our swc packages to allow us to remove the `optionalDependencies` which is slowing down install time as well. 

x-ref: #32679
x-ref: #32627
x-ref: #31887
x-ref: vercel/styled-jsx#770
@huozhi
Copy link
Member

huozhi commented Jan 19, 2022

Resolved by #32742 , you can install latest canary (next@12.0.9-canary.2) to get rid of this warning

@huozhi huozhi closed this as completed Jan 19, 2022
NiGhTTraX added a commit to NiGhTTraX/ts-monorepo that referenced this issue Jan 24, 2022
This reverts the workarounds for #159, #74 and #60, as they are no
longer needed.

There are a few peer dependency warnings, though the examples work just
fine:

- The one for NextJS is tracked in
vercel/next.js#31887.
- CRACO support for CRA@5 is tracked in
dilanx/craco#378.
- The warnings for CRA are tracked in
facebook/create-react-app#11982, except for
the `ts-jest` one which is expected, since we're using CRA's `jest`.
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
This ncc's some remaining dependencies bringing us under 20 install time dependencies (including nested dependencies), this also reduces install size by another `2.75 MB`. A follow-up PR will investigate a custom install script for our swc packages to allow us to remove the `optionalDependencies` which is slowing down install time as well. 

x-ref: vercel#32679
x-ref: vercel#32627
x-ref: vercel#31887
x-ref: vercel/styled-jsx#770
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants