-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Uncaught SyntaxError: Unexpected token ? #14175
Comments
This is by design, support for legacy browsers is a build-only feature. During dev mode, Vite doesn't transpile files. |
@sapphi-red Please re-open this. The build is not working in legacy browsers. I created a build and used |
Your browserslist doesn't contain Chrome 69. So it's expected. plugin-legacy 3.x didn't respect browserslist and it was fixed since 4.0.0. |
@sapphi-red Thanks. But, that alone didn't help. I had to configure the plugin like this:
For browser list, I put I am wondering why I had to specify Chrome 69 supports es6 modules, so I assumed I don't need to render legacy chunks. |
I see. That part of the document was incorrect: #14233 |
Describe the bug
After upgrading from Vite 3.2.7 to 4.4.9, my production build is not working in old browsers, despite using vite legacy plugin. Reverting back to 3.2.7 fixes the issue, so the bug is somewhere in Vite v4.
The error I get when I try to load an app in Chrome 69 for example results in this error:
Uncaught SyntaxError: Unexpected token ?
Reproduction
https://github.com/paradox37/monorepo/tree/vite-legacy-bug
Steps to reproduce
yarn install
yarn build
yarn preview
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: