-
Notifications
You must be signed in to change notification settings - Fork 268
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
bug: missing @babel/runtime dependency in yarn modern with pnp linker #2218
Labels
bug
Something isn't working
released
status:confirmed
Described issue has been reproduced by the repo maintainer
Comments
Hey, @imccausl, thank you for the detailed issue report (and the PR), we really appreciate it! Let us take a look at it and we'll get back to you ASAP. :) |
arnautov-anton
added
status:confirmed
Described issue has been reproduced by the repo maintainer
and removed
status: unconfirmed
labels
Dec 21, 2023
arnautov-anton
added a commit
that referenced
this issue
Dec 21, 2023
# Submit a pull request ### 🎯 Goal Fixes #2218 Provides better compatibility with yarn modern's pnp linker (maybe also pnpm?) by explicitly providing required dependencies. ### 🛠 Implementation details N/A ### 🎨 UI Changes N/A Co-authored-by: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com>
🎉 This issue has been resolved in version 11.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Getting back as promised; we've reviewed it and as you can see confirmed your issue - again, thank you for your contribution, @imccausl! :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
released
status:confirmed
Described issue has been reproduced by the repo maintainer
Describe the bug
In yarn modern (version 2+) with the pnp linker, tests and build fails because helpers provided by @babel/runtime are missing. I believe @babel/runtime gets hoisted from another dependency (possibly aria-query according to
yarn why @babel/runtime
) in regular npm/yarn v1 so it seems to work. Yarn modern is more strict with dependency resolution, so I see failures after importing stream-chat-react components into a project and trying to run tests or build.While I can also fix this by providing @babel/runtime myself, I don't think this is the "correct" solution. Rather, the solution should be to include @babel/runtime as a dependency in this project. From what I can tell, this is what is recommended when using @babel/plugin-transform-runtime according to the babel docs (unless I am misinterpreting what is written there, but I see a lot of other libraries that supply their own versions of @babel/runtime). See the the "technical details" section of babel-plugin-transform-runtime (https://babeljs.io/docs/babel-plugin-transform-runtime#technical-details):
I am happy to submit a PR to fix this issue. And would love to hear your thoughts!
To Reproduce
I've created a bug repro repo here: https://github.com/imccausl/stream-chat-react-yarn-modern-bug-repro-repo
Steps to reproduce the behaviour:
nvm use && yarn install
(uses yarn v4 with the pnp linker)yarn build
to "build" the project with babel and webpack. You'll get an error:Can't resolve '@babel/runtime/helpers/defineProperty
yarn test
to run tests (transpiled with babel). You'll get an error:Cannot find module '@babel/runtime/helpers/extends'
stream-chat-react
repo withyarn link /path/to/stream-chat-react
(replacing /path/to with the correct path to your local stream-chat-react repo).yarn add @babel/runtime
(@babel/runtime should be a direct dependency not a dev dependency)yarn test
oryarn build
in thestream-chat-react-yarn-modern-bug-repro-repo
will now work.Expected behaviour
I expect that the required @babel/runtime helpers are provided by the 3rd party library I'm using so that my test and build don't fail. I shouldn't have to provide this in my project if I'm not using @babel/plugin-transform-runtime` for any of my own transpiled code.
Screenshots
N/A
Package version
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: