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
UTF-8 with BOM files cause vite to fail import rewrite #3162
Comments
Hello @rjregenold. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution! |
Looks like @Aaron-Pool already digged into this: #814 (comment) |
I am glad to pick up this issue! |
Declaring this as a |
Describe the bug
The issue described in #806 is happening again in vite 2.2.1 (and 2.2.3). If a file uses UTF-8 with BOM encoding, the first line of the file is not rewritten correctly.
Reproduction
https://github.com/rjregenold/vite-utf8-bom-issue/blob/master/src/main.js
The
main.js
file is saved with UTF-8 with BOM encoding. When running the app in development mode, the following error appears in the console:System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: yarn
Logs
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: