Investigation: Code included from @codemirror/view causes Chromium to recognize my extension bundle to be detected as non-UTF8

I’m not sure how to investigate this fully, but through trial and error, I have narrowed down the issue to "when I import EditorView from “@codemirror/view” and attempt to build a bundle, then my Chromium-based browser (I’m using Arc, now) believes that the extension is non-UTF-8. Giving me the following error:

Anything come to mind with weird characters? I tried replacing the funny character in style-mod for their Symbol.for, but I don’t think that made a difference in their detection. I suspect I may need to see if Chromium’s source code tells us how they detect non-utf8 files, but I will take a while to figure out how to navigate that site.

All the files in the distribution are utf-8, and don’t trigger this issue for other users, so I’d look into what your build process is doing to the code.

1 Like

I’ll try to make a minimum reproduction to look at minimal bundled code. Thanks for the initial thought in case there was something that came to mind :slight_smile:

Something in vite replaces const LineBreakPlaceholder = "\uffff"; with const LineBreakPlaceholder = "￿";

I don’t have any interesting Vite plugins, so I’m kinda bummed I might need to make a custom patching plugin for this.