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

fix: mark @babel/core as optional peer dependency #739

Merged
merged 4 commits into from
Aug 30, 2021
Merged

fix: mark @babel/core as optional peer dependency #739

merged 4 commits into from
Aug 30, 2021

Conversation

spa5k
Copy link
Contributor

@spa5k spa5k commented Aug 27, 2021

Fixes The missing dependency error that comes while installing it through Yarn 2, Yarn 3.
and also fixes #736

Error -
styled-jsx@npm:4.0.0 [78a22] doesn't provide @babel/core (pad17e), requested by @babel/plugin-syntax-jsx

The user needs to add

packageExtensions:
  styled-jsx@*:
    dependencies:
      "@babel/core": "*"

in .yarnrc.yml even when they're not using this dependency directly, for example while using next.js

Moving `@babel/core` from devDependencies to dependencies.
Fixes the missing dependency error that comes while installing it through `Yarn 2, Yarn 3`.

Error - 
`
styled-jsx@npm:4.0.0 [78a22] doesn't provide @babel/core (pad17e), requested by @babel/plugin-syntax-jsx
`
@spa5k spa5k requested a review from giuseppeg as a code owner August 27, 2021 17:57
@spa5k spa5k changed the title Fixes https://github.com/vercel/styled-jsx/issues/736 fix: moving @babel/core from dev dependencies to dependencies Aug 27, 2021
package.json Outdated
@@ -59,6 +59,7 @@
}
},
"dependencies": {
"@babel/core": "7.12.3",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This jsx plugin should use @babel/core on user side so we don't want it to become dependency.

We can add the meta field to package.json to declare it as optional

"peerDependenciesMeta": {
  "@babel/core": {
    "optional": true
  }
}

Copy link
Contributor Author

@spa5k spa5k Aug 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info, did not knew this option existed.

@huozhi huozhi changed the title fix: moving @babel/core from dev dependencies to dependencies fix: mark @babel/core as optional peer dependency Aug 28, 2021
@huozhi
Copy link
Member

huozhi commented Aug 30, 2021

Thanks!

@huozhi huozhi merged commit 69a76f2 into vercel:master Aug 30, 2021
@github-actions
Copy link

🎉 This PR is included in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@0899279111

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

Missing @babel/core dependency
3 participants