If you are getting invalid utf-8 issue here's a fix. #962
rahulnpadalkar
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
After building the extension with
pnpm build
and loading the dist folder using theLoad Unpacked
button in Chrome extensions, I was getting a Invalid UTF-8 file.After a lot of head banging and cursing, i found the issue to be in the minfier that vite uses. ESBuild messes up the utf-8 encoding somehow. The solution is to use terser instead.
To use terser first install it with
pnpm i terser -F <package-name>
and then addminify:terser
to thevite.config.mts
fileThe final file looks like this
Hope this helps someone! Cheers 🍺
Beta Was this translation helpful? Give feedback.
All reactions