bartlomieju / vite-deno-example

Example of using Vite with Deno
https://vite-deno-example.deno.dev
163 stars 7 forks source link

[BUG] HMR not working #6

Closed angelhdzdev closed 1 year ago

angelhdzdev commented 1 year ago

I had the issue with the vue package throwing errors, and solved it with the imports in deno.json as per another issue, thank you!

Now I can't get HMR working.

The HMR shows output in VSCode terminal of being updated, but the content in the browser doesn't change.

Any kind tip would be appreciated.

angelhdzdev commented 1 year ago

Update

The content in the browser updates by doing a browser refresh (F5). I think this may be a vital information.

angelhdzdev commented 1 year ago

Update 3

Browser console:

image

angelhdzdev commented 1 year ago

Solved

I labeled this issue as [BUG] because since I started with Vue and Vite, I didn't have to set up anything to get HMR working.

I solved this by adding the following to Vite config:


server: {
    hmr: {
      protocol: 'ws',
      host: 'localhost',
      port: 3001
    }
  }