-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Fails to load config with Excepted identifier but found "import"
error
#19018
Comments
This error can be reproduced by using
|
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
I found the same problem in my environment, but the following command temporarily solved it. pnpm add -D esbuild@=0.24.0
pnpm dedupe |
+1 ran a totally new completely clean build in new pc and got this same error |
This comment was marked as spam.
This comment was marked as spam.
npm i -D [email protected] |
This comment was marked as spam.
This comment was marked as spam.
+1 but downgrading esbuild solves that 😸 |
downgrade vite version working for now. |
This comment was marked as duplicate.
This comment was marked as duplicate.
npm view create-vite versions --json npm create [email protected] 5.5.5 这个版本可用 |
This comment was marked as spam.
This comment was marked as spam.
删除lock文件,删除node_modules,再pnpm install就会复现。 临时修复 pnpm i -D [email protected] |
This comment was marked as spam.
This comment was marked as spam.
please resolve this 🙏 🙏 I've just rollback to vite |
seems like a bug from esbuild. |
This comment was marked as spam.
This comment was marked as spam.
It seems a change in esbuild 0.24.1 is affecting Vite's config loader: evanw/esbuild#4010 The current workaround is to set overrides in package managers:
|
Downgrade to vite 5 |
+1, downgraded to vite 5.5.5 |
I encountered the same error today. After changing Vite to version 5.4.11, it worked fine. It seems that version 6.0 is still unstable. |
Looks like fix on the way: evanw/esbuild#4013 |
it because of es build run "npm install -D vite@^5" on your project root, this version have stable esbuild |
npm i -D [email protected] |
Thanks, it's seem this is the only fix for now. |
The override does not work in a mono repo |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Getting this same error when using terser. |
On my project this override worked {
"name": "Your app",
"devDependencies": {
"vite": "^6.0.4",
},
"overrides": {
"vite": {
"esbuild": "0.24.0"
}
},
}
Then delete the |
Idk what made it work for me. I have a different project where Vite 6 works and I don't even get the above errors. But on another project, it doesn't. What I did: # On my project that doesn't work...
rm -rf node_modules
bun install # or npm install
bun dev # it still didn't work. (weird)
# So to compare with the project that actually worked, I basically...
# 1. Committed my current package.json on the project that doesn't work.
# 2. REMOVED all the `dependencies` and `devDependencies` in the project that doesn't work, then replaced it with the `dependencies` and `devDependencies` of the project that works. (It doesn't matter if the packages don't match).
# 3. Then as usual, I did...
rm -rf node_modules
bun install
bun dev # And this time it worked, cool.
# 4. After that, I stashed the current package.json changes. Meaning it will become your current project's non-working package.json. Then as usual, I did this again...
rm -rf node_modules
bun install
bun dev # And it actually worked for the current project. I can't even explain what happened. But if anyone's pulling their hair and looking for an alternative solution, hope this helps 😐 |
Same |
I always need to run - npm i -D [email protected] when i create new react-vite project. Please solve this issue |
"bun": {
"overrides": {
"esbuild": "0.24.0"
}
} |
downgrading vite version solves the above issue |
[email protected] is out pinning to esbuild 0.24.0 until @sapphi-red's PR to esbuild is merged and released, you can update to latest vite to fix this issue |
Thank you very much. I am cured. |
Now that esbuild has released v0.24.2, is it possible to undo #19027? |
Note: [email protected] is out pinning to esbuild 0.24.0 until @sapphi-red's PR to esbuild is merged and released, you can update to latest vite to fix this issue. Leaving this issue open as we'll revert the temporary fix soon.
Workaround and the cause
It seems a change in esbuild 0.24.1 is affecting Vite's config loader: evanw/esbuild#4010
The current workaround is to set overrides in package managers:
Edited by @sapphi-red
Describe the bug
Reproduction
pnpm create vite@latest; babel-react
Steps to reproduce
No response
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: