bartlomieju / vite-deno-example

Example of using Vite with Deno

Home Page:https://vite-deno-example.deno.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] HMR not working

angelhdzmultimedia opened this issue · comments

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.

Update

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

Update 3

Browser console:

image

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
    }
  }