DEV Community

Discussion on: Real Vite-React HMR in Chrome Extension Content Scripts

Collapse
 
sanujbansal profile image
sanuj bansal

I see this error

Image description
when I try to add:-
"content_scripts": [
{
"js": ["src/main.jsx"],
"matches": ["google.com/*"]
}
]
Any solutions for this?

Collapse
 
jacksteamdev profile image
Jack Steam

This is a known issue with the new Vite 3.0, but you can install the latest versions of Vite 2 and plugins and things should work as expected:

npm i -D vite@^2 @vitejs/plugin-react@^1
Enter fullscreen mode Exit fullscreen mode

I'm updating the articles so this doesn't continue to trip people up.

Collapse
 
shivraj97 profile image
Shivraj97 • Edited

Hi Jack, This resolved the issue for content script hot reloading but the pop up always shows Waiting for service worker..

Image description

and this is the Error shown in Brave extension page

Image description