-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Class extends value undefined is not a constructor or null #183
Comments
I get the same when adding const SriPlugin = require('webpack-subresource-integrity'); |
Are you using a Webpack <5? |
@jscheid I'm using 4.46.0, so that's when I tried |
Version 5 of this plugin requires Webpack 5. You either need to upgrade Webpack or use version 1.x of this plugin. |
@jscheid thanks, that was the issue. I did notice that constraint and did adhere to the syntax shown on the 1.x branch, and I could've sworn that I reverted the version of webpack-subresource-integrity, but I might've forgotten to install it. Now I'm able to get it to build, but the integrity attribute is being set for all of the external assets. The only asset that is being injected with an integrity attribute is the one in my Scripts folder. I am using HtmlWebpackPlugin with the inject attribute set to true, and the documentation says that should automatically inject the integrity attributes.
But I'm getting scripts like this generated:
|
Sorry, we don't support external scripts at the moment. The primary use case is for bundling your dependencies from npm. See #167. |
When I add the following to my webpack.config.js:
const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity');
I get the following stack trace when trying to build.
TypeError: Class extends value undefined is not a constructor or null
at Object. (%path%\node_modules\webpack-subresource-integrity\index.js:38:49)
at Module._compile (%path%\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (%path%\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at Object. (%path%\webpack.config.js:14:40)
at Module._compile (%path%\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (%path%\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS (%path%\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (%path%\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at %path%\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach ()
at module.exports (%path%\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at %path%\node_modules\webpack-cli\bin\cli.js:71:45
at Object.parse (%path%\node_modules\webpack-cli\node_modules\yargs\yargs.js:576:18)
at %path%\node_modules\webpack-cli\bin\cli.js:49:8
at Object. (%path%\node_modules\webpack-cli\bin\cli.js:366:3)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (%path%\node_modules\webpack\bin\webpack.js:156:2)
Process terminated with code 1.
The text was updated successfully, but these errors were encountered: