question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gregbergecommented, Nov 27, 2018

Fixed in v5.2.1

0reactions
willdurandcommented, Nov 28, 2018

Fixed in v5.2.1

Yep, it works well. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found