-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding @babel/preset-env cause error #2722
Comments
Hello @marialovesbeans. Please provide a online reproduction by codesandbox or a minimal GitHub repository. Issues labeled by |
I'm not sure if this is reproducible on codesandbox as this is the building process. But any vitejs project adding this in the "babel": {
"presets": [
"@babel/preset-env"
]
}, |
underfin
added a commit
that referenced
this issue
Mar 29, 2021
yyx990803
pushed a commit
that referenced
this issue
Mar 31, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In my case, I'm trying to add Jest for unit testing. Jest needs to transpile the unit test code to ES5 before running it, because there're some ESNext syntax node.js does not understand, such as nullish assignment operator
?=
.However, I'm sure there're tons of other scenarios adding
@babel/preset-env
is necessary, so it's impactful to have this bug fixed.Step 1)
yarn add @babel/preset-env
Step 2) Add to package.json:
Result:
Launch website at
http://localhost:3000
, the webpage crashes, logging error in the browser:Uncaught SyntaxError: The requested module '/src/App.jsx' does not provide an export named 'default'
Why does adding this cause such an error? How can I fix this?
The text was updated successfully, but these errors were encountered: