TypeError: Super expression must either be null or a function, not undefined
See original GitHub issueI am getting this error after upgrading to webpack v4. Strangely this happens only in the prod build and not in dev build.
This is the stack-trace in browser console:
TypeError: Super expression must either be null or a function, not undefined
bundle-f82b2570e6fa0145fdb8.js:22:54086
n.withStyles/</n</<
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:22:54086
n.withStyles/</n<
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:22:54066
n.withStyles/<
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:22:53698
<anonymous>
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:36:433740
t
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:1:105
<anonymous>
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:84:260717
t
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:1:105
<anonymous>
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:84:263006
t
http://localhost:8000/js/bundle-f82b2570e6fa0145fdb8.js:1:105
I am actually using react-dates
which is using this library. From stacktrace, I suspect this is where the error is coming from. Also removing react-dates
makes the error to go away.
Here is my entire webpack config: https://gist.github.com/tejasbubane/9ae4d2e099bef97b3b118f99a163294e
Relevant libraries and their versions:
"react": "^15.6.1",
"react-dates": "^15.5.3",
"react-with-styles": "=2.2.0",
"webpack": "^4.12.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Uncaught TypeError: Super expression must either be null or ...
This means that you want subclass something, which should be Class , but is undefined . The ...
Read more >React Errors : Super expression must either be null or a function
Have you come across this error when working with React? Uncaught TypeError: Super expression must either be null or a function, not undefined....
Read more >React Errors : Super expression must either be null or a function
Firstly, if you're certain that you're extending from the correctly named class, e.g. React.Component, not React.component or React.
Read more >TypeError: Super expression must either be null or a function ...
I got here just by googling the OP's error. In my case, the issue only appears when I run a 'release', minified build,...
Read more >Uncaught TypeError: Super expression must either be null or ...
After making production build i am getting this error in console and application is not getting loaded. My Environment: OS: Linux/Ubuntu ...
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
For anyone who run into this issue setting
keep_fnames: true
for uglifyjs helps. Maybe because of this https://github.com/mishoo/UglifyJS2/issues/3015#issuecomment-375185061Hard to say what might be happening here without more information.
According to this Stack Overflow post, it looks like this might happen if something extends
React.component
instead ofReact.Component
. Do you think anything like that could be happening?Could you post some of the code from your stack trace?