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/[email protected] 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,
next add @babel/core as dependency, and mark @babel/core as required peerDependency in styled-jsx.
next add @babel/core as peerDependency, and let user add @bable/core in their own project.
- 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.
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/[email protected] requires a peer of @babel/core@^7.0.0-0 but none was installed.
package
nextrequiresstyled-jsxwhich has a unversioned optional peerDep@babel/core, but styled-jsx also requires@babel/plugin-syntax-jsxwhich has a required peerDep@babel/core. Andnextdoes not require@babel/core.This ends up with
@babel/plugin-syntax-jsxmissed 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.@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.