Can't resolve '@babel/runtime/regenerator' in monorepo
See original GitHub issueBefore you start - checklist
- I followed instructions in documentation written for my React-PDF version
- I have checked if this bug is not already reported
- I have checked if an issue is not listed in Known issues
Description
The 4.0.3 version fails with runtime error on npm start (during webpack compilation):
pdfjs-dist/2.1.266/node_modules/pdfjs-dist/lib/web/ui_utils.js
Module not found: Can't resolve '@babel/runtime/regenerator' in '/pdfjs-dist/2.1.266/node_modules/pdfjs-dist/lib/web'
In 4.0.2, adding babel-runtime as a dependency did the trick. Now I’m unable to have it working any other way.
Steps to reproduce
Update from 4.0.2 to 4.0.3. Not reproducible on the sample project.
Expected behavior
I don’t expect a failure.
Additional information
I found some issues talking about a similar error, but nothing on 4.0.3 with no workaround. I tried the webpack entry without any luck.
Environment
- React-PDF version 4.0.3:
- React version 16.8.3:
- Webpack version 4.29.3:
- Typescript version 3.3.3
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Module not found: Can't resolve @babel/runtime/helpers
To solve the error "Module not found: Error: Can't resolve '@babel/runtime/helpers'", make sure to install the @babel/runtime package by opening your terminal ...
Read more >How to fix "Can't resolve '@babel/runtime/regenerator' in npm ...
The temporary fix I found is to npm install --no-save @babel/runtime in the core dependencies repositories, but this get removed each time I...
Read more >Upgrade to Babel 7
For monorepos we have added a new babel.config.js file that centralizes our config across all the packages (alternatively you could make a config...
Read more >@babel/runtime | Yarn - Package Manager
:rocket: [New Feature]; :bug: [Bug Fix]; :memo: [Documentation] ...
Read more >Cannot find module 'babel-runtime/regenerator' Import locally ...
[Solved]-Cannot find module 'babel-runtime/regenerator' Import locally vs Import from NPM-babel.js · the transform plugin babel-plugin-transform-runtime (which ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Appreciate your reactivity and thank you for this repository, it’s really cool! I’ll be happy to contribute if need be.
Thank you @wojtekmaj . As you pointed it to be only a dependency issue when having react-pdf as a third level dependency, I was able to make it work, with adding @babel/runtime as a dependency of the root project (not the cleanest way, but works). I haven’t tried the Provide plugin, but it looks like it would work for me as well, I’ll give it a try as it would be cleaner.