Open rbhalla opened 2 years ago
I'm not sure Docker is the problem here... I experience similar symptoms in my environment without Docker. I have noticed that when running vite dev
, ensuring you are working with vite@2 and React as you are:
action.default_popup
setting in the manifest), HMR works mostly reliably.You will notice the same symptoms if you compare popups and content scripts in the Getting Started tutorial. Popups refresh right away; content scripts require multiple saves.
I'm really hoping once support drops for vite@3 this all gets sorted out!
Good validation, maybe I went down the wrong path with this issue. I too am using content scripts over the popups, so maybe that's the actual theme here.
This issue might be fixed in @crxjs/vite-plugin@^2
, which in beta right now; you can test it using:
npm i @crxjs/vite-plugin@beta -D
@jacksteamdev I'm also getting inconsistent behaviour with HMR. I'm creating a reasonably complex extension with many different UI context and styles.
Working:
Not working:
But for the ones that are "not working", I can also see that HMR was indeed triggered in the Terminal.
Pertinent versions:
"@crxjs/vite-plugin": "^2.0.0-beta.16",
"vite": "^4.2.1",
"@vitejs/plugin-vue": "^4.1.0",
Should I open a new issue maybe? Seemed relevant to this one I thought @jacksteamdev
I also had the same issue with svelte, Css would not hot reload / lag a single Hot reload behind, but html svelte always is up to date
Build tool
Vite
Where do you see the problem?
Describe the bug
When a file is modified, I am seeing vite log it in the browser console and in the terminal. However the component itself does not actually update. I have to manually refresh to see the change.
One possible contributor here, is that I am running vite in a docker container. However, looking online, I have seen no evidence to suggest that vite usually struggles with docker as long as the server port is configured correctly.
Reproduction
Using the starter vite project as described in the docs in typescript mode.
This is my docker compose configuration:
My
vite.config.js
Logs
Console:
System Info
Severity
blocking an upgrade