Critical dependency: the request of a dependency is an expression
See original GitHub issueBug report
What is the current behavior?
My testing-app is compiling fine, except that I get this warning: " Critical dependency: the request of a dependency is an expression"
(base) marco@pc01:~/webMatters/vueMatters/PeerJS-VueJS-Test$ npm run serve
> testproject@0.1.0 serve /home/marco/webMatters/vueMatters/PeerJS-VueJS-Test
> vue-cli-service serve
INFO Starting development server...
98% after emitting CopyPlugin
WARNING Compiled with 1 warnings
7:22:25 PM
warning in ./node_modules/peerjs/dist/peerjs.min.js
Critical dependency: the request of a dependency is an expression
App running at:
- Local: http://localhost:8080
- Network: http://ggc.world/
Note that the development build is not optimized.
To create a production build, run npm run build.
I read around that it might depend of webpack, but didn’t find how to put it right.
This is webpack.config.js :
{
"mode": "development",
"output": {
"path": __dirname+'/static',
"filename": "[name].[chunkhash:8].js"
},
"module": {
"rules": [
{
"test": /\.vue$/,
"exclude": /node_modules/,
"use": "vue-loader"
},
{
"test": /\.pem$/,
"use": "file-loader"
}
]
},
node: {
__dirname: false,
__filename: false
},
resolve: {
extension: ['*', '.pem'],
},
devServer: {
watchOptions: {
aggregateTimeout: 300,
poll: 1000
},
https: true,
compress: true,
public: 'ggc.world:8080'
}
}
Any ideas about how to solve it?
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Other relevant information: webpack version: npm view webpack version 4.42.0 Node.js version: v12.15.0 Operating System: Ubuntu 18.04.4 Desktop Additional tools:
(base) marco@pc01:~/webMatters/vueMatters/PeerJS-VueJS-Test$ vue info
Environment Info:
System:
OS: Linux 5.3 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
Binaries:
Node: 12.15.0 - ~/.nvm/versions/node/v12.15.0/bin/node
Yarn: Not Found
npm: 6.13.4 - ~/.nvm/versions/node/v12.15.0/bin/npm
Browsers:
Chrome: 80.0.3987.122
Firefox: 73.0.1
npmPackages:
@vue/babel-helper-vue-jsx-merge-props: 1.0.0
@vue/babel-plugin-transform-vue-jsx: 1.1.2
@vue/babel-preset-app: 4.2.3
@vue/babel-preset-jsx: 1.1.2
@vue/babel-sugar-functional-vue: 1.1.2
@vue/babel-sugar-inject-h: 1.1.2
@vue/babel-sugar-v-model: 1.1.2
@vue/babel-sugar-v-on: 1.1.2
@vue/cli-overlay: 4.2.3
@vue/cli-plugin-babel: ^4.1.2 => 4.2.3
@vue/cli-plugin-eslint: ^4.1.2 => 4.2.3
@vue/cli-plugin-router: 4.2.3
@vue/cli-plugin-vuex: 4.2.3
@vue/cli-service: ^4.1.0 => 4.2.3
@vue/cli-shared-utils: 4.2.3
@vue/component-compiler-utils: 3.1.1
@vue/preload-webpack-plugin: 1.1.1
@vue/web-component-wrapper: 1.2.0
eslint-plugin-vue: ^5.0.0 => 5.2.3
vue: ^2.6.10 => 2.6.11
vue-eslint-parser: 5.0.0
vue-hot-reload-api: 2.3.4
vue-loader: 15.9.0
vue-style-loader: 4.1.2
vue-template-compiler: ^2.6.10 => 2.6.11
vue-template-es2015-compiler: 1.9.1
npmGlobalPackages:
@vue/cli: 4.1.2
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 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 webpack - You ...
Webpack - Critical dependency: the request of a dependency is an expression ... When a library uses variables or expressions in a require...
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 >Integration with WebPack - Linkurious documentation
The optional dependencies used by Ogma is the xlsx library (to export in the XLSX ... Critical dependency: the request of a dependency...
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

It is warning and it is expected because it is
Critical dependency: the request of a dependency is an expression, fix your code, you don’t provide code so we can’t help, sorrysame question