-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Bug Description
I tried to use streamdown
in my browser extension.
It works on the popup script, but not for all content script.
The error message is Could not load file 'content-scripts/content.js' for content script. It isn't UTF-8 encoded.
Steps to Reproduce
- clone the repo for reproduction: https://github.com/mengxi-ream/streamdown-wxt-bug
pnpm i
pnpm dev
The you will seestreamdown
works in the popup script

and you now the content script is successfully loaded as we can see hello world
is injected to any website.

And then we uncomment the code in content/App.tsx
:
import StreamdownExample from "@/components/ui/streamdown-exmaple";
export default function App() {
return (
<div className="bg-yellow-400 z-[2147483647] text-2xl">Hello World
{/* TODO: uncomment this to see the bug: Could not load file 'content-scripts/content.js' for content script. It isn't UTF-8 encoded. */}
{/* <StreamdownExample /> */}
</div>);
}
And then pnpm dev
again to restart the browser extension, we will see the error:
Could not load file 'content-scripts/content.js' for content script. It isn't UTF-8 encoded.
CleanShot.2025-09-18.at.23.25.05.mp4
Expected Behavior
can load the <StreamdownExample />
in the content script just like it in the popup script
Actual Behavior
got error in background: Could not load file 'content-scripts/content.js' for content script. It isn't UTF-8 encoded.
Code Sample
https://github.com/mengxi-ream/streamdown-wxt-bug
Streamdown Version
1.3.0
React Version
19.1.1
Node.js Version
22.14.0
Browser(s)
Chrome
Operating System
macOS
Additional Context
We are developing an AI browser extension (https://github.com/mengxi-ream/read-frog) and wish to use Streamdown in the future, which I think it's common case for all AI browser extensions (to use Streamdown in the content script)