Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
See original GitHub issue./node_modules/pdfjs-dist/build/pdf.js | Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
I get the above error on npm start
I installed react-pdf as mentioned in the docs.
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.0",
"react-scripts": "2.1.8"
above is the structure of package.json and I installed react-pdf version 4.1.0
I used create-react-app
to make the app.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Critical dependency: require function is used in a way in which ...
Critical dependency : require function is used in a way in which dependencies cannot be statically extracted · Subscribe to RSS.
Read more >Critical dependency: require function is used in a way ... - GitHub
The error originates from the esm target, which should not have any require statements. It'd be nice to explore that built module and...
Read more >Incompatible with Webpack - Google Groups
"require function is used in a way, in which dependencies cannot be statically extracted" These errors come when trying to "require" specific modules, ......
Read more >Node.js – WARNING in Critical dependency: require function ...
Node.js – WARNING in Critical dependency: require function is used in a way in which dependencies cannot be statically extracted. angularnode.jswebpack.
Read more >Critical dependency: require function is ... - Auth0 Community
Critical dependency : require function is used in a way in which dependencies cannot be statically extracted ; samueljbarrick May 4, 2020, 10:28pm ......
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
Copy of - https://github.com/wojtekmaj/react-pdf/issues/280, everyone are waiting for a fix 😃
My full workaround. Create a file at the root called config-overrides.js and it should contain the following: module.exports = function override(config) { config.module.rules[0].parser.requireEnsure = true return config };
After that npm i react-app-rewired to you app and change your build function in package.json to read react-app-rewired build/react-app-rewired start. That should do it for now.