TypeError: Super expression must either be null or a function
See original GitHub issueI recently have this error without changing anything in my code.
Error
> Build error occurred TypeError: Super expression must either be null or a function at _inherits (.../node_modules/@babel/runtime/helpers/inherits.js:5:11) at .../node_modules/@streetscape.gl/core/dist/es5/components/log-viewer/perspective-popup.js:102:29 at Object.<anonymous> (.../node_modules/@streetscape.gl/core/dist/es5/components/log-viewer/perspective-popup.js:204:2) at Module._compile (internal/modules/cjs/loader.js:1256:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10) at Module.load (internal/modules/cjs/loader.js:1105:32) at Function.Module._load (internal/modules/cjs/loader.js:967:14) at Module.require (internal/modules/cjs/loader.js:1145:19) at require (internal/modules/cjs/helpers.js:75:18) at Object.<anonymous> (.../node_modules/@streetscape.gl/core/dist/es5/components/log-viewer/object-labels-overlay.js:30:48) { type: 'TypeError' }
Environment
- streetscape.gl v1.0.6
- nextJS v9.5.3
- node v14.7.0
- npm v6.14.7
Steps to Reproduce
npm run build
The error happened only during build in production.
It seems related to babel
parsing node_modules.
I tried differents webpack configs, like keep_fnames: true
on the minimizer plugin Terser
or UglifyJS
like this issue https://github.com/facebook/create-react-app/issues/7236 but none worked.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (2 by maintainers)
Top GitHub Comments
This is caused by react-map-gl switching to functional components. You can work around this with the following in package.json:
I need to publish a new release, then it should work