Critical dependency: the request of a dependency is an expression
See original GitHub issueHello, I’m getting this warning when using curlconverter dependency. Any idea how to solve it?
Compiled with warnings.
./node_modules/curlconverter/node_modules/yargs/lib/parser.js
Critical dependency: the request of a dependency is an expression
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Webpack - Critical dependency: the request of a dependency ...
Webpack - Critical dependency: the request of a dependency is an expression · Manually configure webpack to import the required libraries and ...
Read more >Webpack Warning: Critical dependency: the request of a ...
[Edit: This seems to be related with WebPack in General, not with Angular] When activating this module in an Angular 12 project, this...
Read more >the request of a dependency is an expression - You.com
Critical dependency: the request of a dependency is an expression -- react-universal-component · Webpack - Critical dependency: the request of a dependency is...
Read more >the request of a dependency is an expression - Get Help
When I use “require( )” inside a v-bind:src directive, I get “the warning Critical dependency: the request of a dependency is an expression” ......
Read more >Webpack - the request of a dependency is an expression
Webpack – Critical dependency: the request of a dependency is an expression · Manually configure webpack to import the required libraries and prevent...
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 Free
Top 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
Unformentualy not, I’m getting an new error and when I trying to fix it by install @babel/plugin-syntax-import-meta, another issue occurs. Did you test it live? I this it’s better revert to 3.12.0
After running these commands:
Then making this my
vue.config.js
then running
I also see this warning:
When I open the site in my browser though, I see this error in the console:
Looking at the code it’s trying to access
process
somewhere, which should be a Node only variable, it doesn’t exist in the browser.I tried doing
npm install --save process
and changingvue.config.js
toand got this error
which looks like it might be doing
process.stdout.columns
somewhere. I also tried settingprocess
tonull
like thisand it errored somewhere else, so this is a dead end.
I came across https://github.com/yargs/yargs/blob/main/docs/browser.md which suggests that if you want to use yargs in the browser, you have to import a different thing than if you import it from node. So it looks like curlconverter 3 has been un-runnable in the browser since whichever version upgraded yargs to this version that doesn’t work in the browser. I assume this used to work.
curlconverter 4 doesn’t use yargs anymore. You have to copy files from the node_modules/ folder to get it to work, you can see how we do that with webpack for the production website here: https://github.com/curlconverter/curlconverter.github.io/blob/d98b376dd538e8af54934461447099534f27db24/webpack.config.js#L53-L54
We could do something similar to what we do with curlconverter 4, where we have 2 different files for loading the node or the web version of the bash parser here
https://github.com/curlconverter/curlconverter/blob/85403b76642e7b55f03b6c13aa49c7ef126ec29d/src/bash-parser.ts
https://github.com/curlconverter/curlconverter/blob/85403b76642e7b55f03b6c13aa49c7ef126ec29d/src/bash-parser-web.ts
and then use
browser:
in package.json to overwrite one with the other:https://github.com/curlconverter/curlconverter/blob/85403b76642e7b55f03b6c13aa49c7ef126ec29d/package.json#L80
if that’s possible. Then we’d have to release a 3.22.0.
Fortunately, I got curlconverter 4 working with Vue, I had to do this in my vue.config.js
and then I was able to
in App.vue.