vite: Build Error: [rollup-plugin-dynamic-import-variables] Unexpected token
⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.
- Read the docs.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
Describe the bug
can no build this project
Reproduction
https://github.com/HenryWong-fe/vite-project
System Info
viteversion: ^2.0.0- Operating System: mac os 10.15.4
- Node version: v14.15.1
- Package manager (npm/yarn/pnpm) and version: npm 6.14.8
Logs (Optional if provided reproduction)

About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 18 (2 by maintainers)
I’m facing the same issue too while running
npm run buildIf you happen to be running into this with Svelte, a workaround was suggested here. I was getting build errors on .svelte pages that have a style tag and use an environmental variable via import.meta.env.