hapi-webpack-plugin
hapi-webpack-plugin copied to clipboard
Webpack 4 compatibility
When using webpack4, I get the following error. I think it s due to webpack3 dependency mixing with webpack4 new plugin system.
TypeError: Cannot read property 'additionalPass' of undefined at HotModuleReplacementPlugin.apply (/Users/vraptor/WebDev/test/node_modules/webpack/lib/HotModuleReplacementPlugin.js:32:18) at Compiler.apply (/Users/vraptor/WebDev/test/node_modules/hapi-webpack-plugin/node_modules/tapable/lib/Tapable.js:375:16) at new webpack (/Users/vraptor/WebDev/test/node_modules/hapi-webpack-plugin/node_modules/webpack/lib/webpack.js:33:19) at Object.register (/Users/vraptor/WebDev/test/node_modules/hapi-webpack-plugin/lib/index.js:44:16)
Any idea ? Thanks
I have the same problem
@vraptor75011 I found I didn't install webpack-dev-server.You can check to see if you have installed it.
#20 have the same problem. I pushed my vue project on GitHub but I got a warning that I need to update webpack-dev server due to cross origin issues. When I did so, npm run dev shows the error below
TypeError:
Cannot read property 'additionalPass' of undefined
at HotModuleReplacementPlugin.apply (/home/pc-name/node_modules/webpack/lib/HotModuleReplacementPlugin.js:31:18)
at Compiler.apply (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/tapable/lib/Tapable.js:375:16)
at webpack (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack/lib/webpack.js:33:19)
at startDevServer (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack-dev-server/bin/webpack-dev-server.js:335:16)
at portfinder.getPort (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack-dev-server/bin/webpack-dev-server.js:323:5)
at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/lib/portfinder.js:190:16
at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:52:16
at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:269:32
at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:44:16
at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/lib/portfinder.js:151:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /home/pc-name/.npm/_logs/2019-01-15T08_51_57_626Z-debug.log
Attached is the debug log file
[2019-01-15T08_51_57_626Z-debug.log](https://github.com/SimonDegraeve/hapi-webpack-plugin/files/2758821/2019-01-15T08_51_57_626Z-debug.log)
It sucks that upgrading webpack-dev-server causes npm not to run, yet GitHub issues a security alert for using webpack-dev-server version lower than 3.1.14
I have the same problem. I pushed my vue project on GitHub but I got a warning that I need to update webpack-dev server due to cross origin issues. When I did so, npm run dev shows the error below
TypeError: Cannot read property 'additionalPass' of undefined at HotModuleReplacementPlugin.apply (/home/pc-name/node_modules/webpack/lib/HotModuleReplacementPlugin.js:31:18) at Compiler.apply (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/tapable/lib/Tapable.js:375:16) at webpack (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack/lib/webpack.js:33:19) at startDevServer (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack-dev-server/bin/webpack-dev-server.js:335:16) at portfinder.getPort (/home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/webpack-dev-server/bin/webpack-dev-server.js:323:5) at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/lib/portfinder.js:190:16 at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:52:16 at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:269:32 at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/node_modules/async/lib/async.js:44:16 at /home/pc-name/Documents/project-directory/vue/wise-sayings/node_modules/portfinder/lib/portfinder.js:151:16 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev:
cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /home/pc-name/.npm/_logs/2019-01-15T08_51_57_626Z-debug.log
Attached is the debug log file 2019-01-15T08_51_57_626Z-debug.log
It sucks that upgrading webpack-dev-server causes npm not to run, yet GitHub issues a security alert for using webpack-dev-server version lower than 3.1.14 #20 I got it to work by following this steps
- Initialize your vue project. For now I will use vue-cli v2
vue init template-name project-name
1.1 npm installnpm install
- Install webpack 4.0.0 dependency. It is needed
npm install webpack@^4.0.0
- Install webpack version 3.1.11 or 3.1.14 or whichever one you want 'npm install --save-dev [email protected]'
- Install vue loader 14.2.2 This is because it requires a vue loader and the latest one still has bugs
npm add [email protected]
I hope this helps somebody
Can confirm this issue still exists
It seems this package is unmaintained so I decided to rewrite it in TS and fix all the issues. You can find it here https://github.com/Kamahl19/hapi-webpack-plugin-2
Any plans to support Webpack 4.x
@SimonDegraeve ?
I updated hapi-webpack-plugin
in https://github.com/SimonDegraeve/hapi-webpack-plugin/issues/22 to support Webpack 4.x
. There is a PR attached. Feel free to check it out.