File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Vite and HMR
3
+ description : Learn how to resolve issues with HMR when using Vite.
4
+ ---
5
+
6
+ When using Vite and accessing your app via
7
+ [ dev URLs] ( ../../workspaces/devurls.md ) , you may encounter issues with hot
8
+ module reloading (HMR) not working.
9
+
10
+ ## Why this happens
11
+
12
+ Vite runs a WebSocket for hot module reloading (HMR) and assumes the client will
13
+ listen on a specific port. If this isn't the case, Vite HMR and the client never
14
+ connect.
15
+
16
+ ## How to fix
17
+
18
+ Edit your ` vite.config.js ` file and add the following information to provide the
19
+ appropriate port number:
20
+
21
+ ``` js
22
+ server: {
23
+ hmr: {
24
+ clientPort: 443
25
+ },
26
+ },
27
+ ```
28
+
29
+ If this doesn't resolve the issue, please
30
+ [ contact us] ( https://coder.com/contact ) for further support.
Original file line number Diff line number Diff line change 502
502
},
503
503
{
504
504
"path" : " ./guides/troubleshooting/502error.md"
505
+ },
506
+ {
507
+ "path" : " ./guides/troubleshooting/vite-hmr.md"
505
508
}
506
509
]
507
510
}
You can’t perform that action at this time.
0 commit comments