TypeError in webpack-plugin 5.2.0
See original GitHub issue💥 Regression Report
Latest webpack plugin version (5.2.0
) throws an error when running with the dev server (middleware) and writeToDisk
is set to true
. There is no error when setting this option to false
.
[0] /Users/williamdurand/projects/mozilla/addons-frontend/node_modules/@loadable/webpack-plugin/lib/index.js:64
[0] if (_this.isRequestFromDevServer() && _this.compiler.options.devServer) {
[0] ^
[0]
[0] TypeError: Cannot read property 'options' of undefined
[0] at LoadablePlugin.getManifestOutputPath (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/@loadable/webpack-plugin/lib/index.js:64:60)
[0] at LoadablePlugin.writeAssetsFile (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/@loadable/webpack-plugin/lib/index.js:80:28)
[0] at /Users/williamdurand/projects/mozilla/addons-frontend/node_modules/@loadable/webpack-plugin/lib/index.js:43:15
[0] at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
[0] at AsyncSeriesHook.lazyCompileHook (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/Hook.js:154:20)
[0] at Compiler.emitAssets (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/webpack/lib/Compiler.js:363:19)
[0] at onCompiled (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/webpack/lib/Watching.js:50:19)
[0] at hooks.afterCompile.callAsync.err (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/webpack/lib/Compiler.js:552:14)
[0] at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
[0] at AsyncSeriesHook.lazyCompileHook (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/Hook.js:154:20)
[0] at compilation.seal.err (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/webpack/lib/Compiler.js:549:30)
[0] at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
[0] at AsyncSeriesHook.lazyCompileHook (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/Hook.js:154:20)
[0] at hooks.optimizeAssets.callAsync.err (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/webpack/lib/Compilation.js:1323:35)
[0] at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
[0] at AsyncSeriesHook.lazyCompileHook (/Users/williamdurand/projects/mozilla/addons-frontend/node_modules/tapable/lib/Hook.js:154:20)
Last working version
Worked up to version: 5.0.2
Stopped working in version: 5.2.0
To Reproduce
Steps to reproduce the behavior:
- Upgrade the plugin version in a project configured with
webpack-dev-middleware
?
Expected behavior
No error, ideally 😃
Link to repl or repo (highly encouraged)
- PR: https://github.com/mozilla/addons-frontend/pull/7017 – It is not a small project, though (sorry).
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
5.2.0 Regression: "TypeError: webpack is not a function" when ...
Current behavior Oops...we found an error preparing this test file: cypress/integration/myTest.js The error was: TypeError: webpack is not a ...
Read more >TypeError: MiniCssExtractPlugin is not a constructor
Open the webpack.config.js file. Replace const MiniCssExtractPlugin = require('mini-css-extract-plugin');.
Read more >(0 , react__webpack_imported_module_0__.usehistory) is not ...
Error name: TypeError: reactWEBPACKIMPORTEDMODULE_0.createContext is not a function. Attaching part of screenshot of the issue after running. npm start.
Read more >Webpack Error: Cannot read property .toWebpackConfig of ...
"turbolinks": "^5.2.0",. "webpack": "^5.11.0". },. error TypeError: Cannot read property 'toWebpackConfig' of undefined at Object.
Read more >TypeError in crypto-js node modules (React and Webpack)
const webpack = require('webpack'); const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ...
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
Fixed in v5.2.1
Yep, it works well. Thanks!