@babel/runtime -> SyntaxError: Unexpected token export -> helpers/esm/extends
See original GitHub issueBug Report
Current Behavior
export default function _extends() {
^^^^^^
SyntaxError: Unexpected token export
at Module._compile (internal/modules/cjs/loader.js:721:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at Module.Hook._require.Module.require (/Users/parent/child/node_modules/require-in-the-middle/index.js:80:39)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.call (/Users/parent/child/server/webpack:/external "@babel/runtime/helpers/esm/extends":1:18)
at r (/Users/<abs-path>/parent/child/server/webpack:/webpack/bootstrap:25:22)
Input Code babelrc
{
"presets": [
["env", {
"targets": {
"uglify": true,
},
"modules": false,
"useBuiltIns": true
}],
"react",
"stage-1"
],
"env": {
"test": {
"presets": [
"env",
"react",
"stage-1"
]
},
"production": {
"plugins": [
"transform-react-remove-prop-types",
]
}
}
}
Expected behavior/code
Expect no error
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Unexpected token export @babel/runtime/helpers/esm/extends
webpack - @babel/runtime: SyntaxError: Unexpected token export @babel/runtime/helpers/esm/extends - Stack Overflow. Stack Overflow for Teams – ...
Read more >syntaxerror unexpected token 'export' typescript - You.com
This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax....
Read more >How I Fixed The Unexpected Token Error In Jest
I refuse to write my packages with old-skool require() and module.export and all those other aging conventions. It's 2021, dammit. Babel ...
Read more >SyntaxError: Unexpected token 'export' in JavaScript
To solve the "Uncaught SyntaxError Unexpected token 'export'" error, set the type property to module in your package.json file.
Read more >Typescript : SyntaxError: Unexpected token 'export'-babel.js
You can fix this by changing to CommonJS, or following the steps outlined in the NodeJS ESM page linked. As for why this...
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 Free
Top 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
Any consistent solution on this?
Hi guys,
getting kind of related error using Next.js…
here is my sandbox: Sandbox-code
Any view/update on how to fix this? I am kind of stuck for days…
Much appreciated!