-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Description
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,
nextadd@babel/coreas dependency, and mark@babel/coreas required peerDependency instyled-jsx.nextadd@babel/coreas peerDependency, and let user add@bable/corein their own project.- remove peerDep
@babel/corefrom@babel/plugin-syntax-jsx(I had a look into this package, I am not really sure why did they add@babel/coreas its peerDep)
Expected Behavior
Clear dependency.
To Reproduce
No need.
aabuhijleh and HiDeoo
Metadata
Metadata
Assignees
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers