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
Module not found: Can't resolve '@babel/runtime/helpers/esm/extends' #9746
Comments
Hey @HeleneBigSofa! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Can you post all your package.jsons? |
Thank you Nicolo to take the time to look at this. The package.jsons:
In package1:
In package2:
|
I think that the problem is that lerna assumes that you aren't using I would try adding Your package.json also has two other problems:
|
Thank you for your reply and solutions Nicolo, well appreciated. |
Point 1 and 2 are just "details", I don't think that they will solve your problem. |
it says: |
And doesn't |
Yes it is definitely there. And if I import it with:
it's found. I can import this with no problem for example: |
I set up a repo that reproduce the error: https://github.com/htmlene/monorepo When I first raised the issue, I gave a simplistic example by calling directly @babel/runtime in the package2. The monorepo example is closer to the reality as @babel/runtime is required by a dependency "react-router" (+history/react-router-dom) - I hope it makes sense, let me know if you have any questions. |
I will check it later today |
Thank you Nicolo, it's very kind of you |
I think that this might be a bug with |
Thank you Nicolo. Do you think reverting to the previous version of @babel we were on would solve the issue? |
I'm don't think so, but it might be worth trying |
We have finally managed to solve our issue, using react-app-rewired, customize-cra and a custom config. |
We have met the same problem. Was there news about this ? |
I have the same problem and did not resolve yet |
@HeleneBigSofa Do you mind sharing the solution? Thanks |
We just upgraded react-script to version 2.1.8 |
@HeleneBigSofa thank you. Sorry but I have a different question then: how did you manage to get the monorepo to work if react-script dropped its support after the version you were using? |
Same problem with MDX + Next. Tried a few recommended workaround – nothing helps. |
Same problem when building a relatively simple package with rollup... No solution works so far.. |
Module not found for I assume this is the same root issue and no fix has worked thus far either. EDIT: Rolling react scripts back to an earlier version (2.1.4 which was what I use in another project) solved the issue for me |
Is the |
I fixed mine by
|
Bug Report
Current Behavior
I created an app within a monorepo (Lerna) using yarn workspace and create-react-app ("react-scripts": "2.0.0-next.3e165448").
The architecture of the app is as follow:
- @babel
- core
- runtime
- etc..
- other modules...
- src
- package.json
- src
- package.json
Input Code
Calling
import _extends from '@babel/runtime/helpers/esm/extends';
from package2/index.js (or in any dependencies of package1) results in this error:
Module not found: Can't resolve '@babel/runtime/helpers/esm/extends'
Calling any other modules available under /node_modules works fine, even from @babel/core for instance:
import _default from '@babel/core/lib/tools/build-external-helpers';
works correctly.
Please note, if I replace @babel/runtime/... with the absolute path it would work.
Expected behavior/code
Need to be able to call @babel/runtime/...
Babel Configuration (.babelrc, package.json, cli command)
In the package.json root:
Environment
The text was updated successfully, but these errors were encountered: