Skip to content
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

An unhandled exception occurred: Class extends value undefined is not a constructor or null #174

Open
Franccescalee opened this issue Feb 4, 2022 · 5 comments

Comments

@Franccescalee
Copy link

Franccescalee commented Feb 4, 2022

Trying to run ng build of my app and I am getting the "An unhandled exception occurred: Class extends value undefined is not a constructor or null" error. Any help would be greatly appreciated. Using latest of webpack-subresource-integrity, latest @angular-devkit\build-angular & latest Typescript.

[error] TypeError: Class extends value undefined is not a constructor or null
at Object. (...\ClientApp\node_modules\webpack-subresource-integrity\index.js:38:49)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (...I\ClientApp\node_modules@angular-devkit\build-angular\src\webpack\configs\common.js:38:41)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object. (...\ClientApp\node_modules@angular-devkit\build-angular\src\webpack\configs\index.js:21:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)


node_modules\webpack-subresource-integrity\index.js:38:49
class AddLazySriRuntimeModule extends webpack_1.RuntimeModule {

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2022

Could you send over your package-lock.json or yarn.lock file? And your package.json would be good to see as well.

@Franccescalee
Copy link
Author

Franccescalee commented Feb 5, 2022

I have attached those files in a zip. Thank you for your help!
files.zip

@jscheid
Copy link
Collaborator

jscheid commented Feb 5, 2022

No problem. Your use of storybook forces Webpack to version 4:

$ grep version node_modules/webpack/package.json
  "version": "4.44.2",

That version is incompatible with a number of other dependencies you've installed, including the version of our plugin that you're using (5.1.0).

To fix this, remove storybook or enable Webpack 5 support for storybook, then ensure that you're using Webpack 5.

I'll leave this ticket open as a reminder to myself that we should probably print a more helpful error message in this case.

@Franccescalee
Copy link
Author

It looks like I need to update some other libraries as well but I am no longer running into the original error after enabling Webpack 5 for storybook. Thank you again for your help!

@Franccescalee
Copy link
Author

Sorry, you said you were going to leave it open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants