Attempted Import Error: 'default' Is Not Exported From '../assertThisInitialized/_index.mjs'
Suddenly my react is application throwing this error ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js Attempted import error: 'default' is not exported from '../a
Solution 1:
Try specifying explicit versions of Babel and webpack
Use an older version of Babel Runtime 7.12.13 or older
Solution 2:
Work around . double click on the error file path to open the file. ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js file and remove '/index.mjs' from the path .
export {default} from '../assertThisInitialized'
Solution 3:
I got the solution. Add "@babel/runtime@7.5.0" under resolutions in package.json to force babel-preset-react-app to use @babel/runtime@7.5.0
"resolutions": {
"**/@babel/runtime": "7.5.0"
},
Post a Comment for "Attempted Import Error: 'default' Is Not Exported From '../assertThisInitialized/_index.mjs'"