Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
See original GitHub issueI’m getting this warning in the console:
./node_modules/@0x/utils/node_modules/ethers/dist/ethers.min.js Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
I’m importing into my files the following:
import { Contract } from '@ethersproject/contracts';
import { Web3Provider } from '@ethersproject/providers';
I’m using Next.js.
Any idea as to why I’m getting this error?
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (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 >Critical dependency: require function is ... - Auth0 Community
Error message : Critical dependency: require function is used in a way in which dependencies cannot be statically extracted.
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 >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
I’m getting the exact same error:
./node_modules/ethers/dist/ethers.min.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
while
ethers
is correctly installed in my project root package json.I’m also using Next.js.
Can you give a code snippet of how you are importing ethers in your project?