browserlist, TypeError: Class constructor "Component" cannot be invoked without 'new'
See original GitHub issueTypeError: Class constructor "Component" cannot be invoked without 'new'
Using the create-react-app 3
, why-did-you-render: v3.0.6
and this import:
const whyDidYouRender = require('@welldone-software/why-did-you-render/dist/no-classes-transpile/umd/whyDidYouRender.min.js')
why-did-you-render: v3.0.6
My browserlist:
"browserslist": {
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
Class constructor cannot be invoked without 'new' in JS
The "Class constructor cannot be invoked without 'new'" error occurs for 2 reasons: Trying to instantiate a class without using the new operator....
Read more >How to fix `Class constructor LitElement cannot be invoked ...
The project structure is not an issue and parceljs will detect browserslist regardless of index.html and other source files location.
Read more >Legacy browser support | Rest Hooks
If you see, Uncaught TypeError: Class constructor Resource cannot be invoked without 'new' this is most likely due to targeting Internet ...
Read more >TypeError: Class constructor HTMLElement cannot be invoked ...
TypeError : Class constructor HTMLElement cannot be invoked without 'new' · 1) Install custom elements es5 adapter for your project. npm i custom- ......
Read more >class constructor cannot be invoked without 'new' angular ...
TypeError : Class constructor Home cannot be invoked without 'new' ; 1. import React, { Component } from 'react' ; 2. import {...
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
After several tests, I finally understood what is happening.
If in my
package.json
I use the new CRA 3 default below:deleting before npm start the
node_modules/.cache
folder it doesn’t work!Re-deleting .cache folder with your below browserlist in package.json it works!
yes of course
@frederikhors as far as i know it should work. we have tests that verify these scenarios. there are, however, some serious issues with browserlist cache that are not related to the project.
please do the following:
node_modules/.cache
if the issue remains, you are free to reopen this issue and specify: