Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.0 broke HMR #414

Closed
mseeley opened this issue Jun 6, 2024 · 4 comments
Closed

0.9.0 broke HMR #414

mseeley opened this issue Jun 6, 2024 · 4 comments

Comments

@mseeley
Copy link

mseeley commented Jun 6, 2024

The change from server.ws.send to server.hot.send has broken HMR.

https://github.com/posva/unplugin-vue-router/blame/d60101cb607e42a3642f72c415adc3e9c0159390/src/core/vite/index.ts#L16

c98ddbf looks like a WIP. Was it meant to go directly into main?

[dev:vite              ]
[dev:vite              ]   VITE v4.4.11  ready in 506 ms
[dev:vite              ]
[dev:vite              ]   ➜  Local:   http://localhost:3210/
[dev:vite              ]   ➜  Network: use --host to expose
[dev:vite              ]   ➜  press h to show help
[dev:vite              ] file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/unplugin-vue-router@0.9.0_rollup@4.0.2_vue-router@4.3.2_vue@3.4.27/node_modules/unplugin-vue-router/dist/chunk-UFHUCJVX.js:1463
[dev:vite              ]     server.hot.send({
[dev:vite              ]                ^
[dev:vite              ]
[dev:vite              ] TypeError: Cannot read properties of undefined (reading 'send')
[dev:vite              ]     at Object.updateRoutes (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/unplugin-vue-router@0.9.0_rollup@4.0.2_vue-router@4.3.2_vue@3.4.27/node_modules/unplugin-vue-router/dist/chunk-UFHUCJVX.js:1463:16)
[dev:vite              ]     at Object.generateRoutes (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/unplugin-vue-router@0.9.0_rollup@4.0.2_vue-router@4.3.2_vue@3.4.27/node_modules/unplugin-vue-router/dist/chunk-UFHUCJVX.js:1377:15)
[dev:vite              ]     at Context.load (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/unplugin-vue-router@0.9.0_rollup@4.0.2_vue-router@4.3.2_vue@3.4.27/node_modules/unplugin-vue-router/dist/chunk-UFHUCJVX.js:1559:20)
[dev:vite              ]     at plugin.load (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/unplugin@1.10.1/node_modules/unplugin/dist/index.mjs:1484:20)
[dev:vite              ]     at Object.load (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/vite@4.4.11_@types+node@20.11.16_sass@1.62.1/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:44316:64)
[dev:vite              ]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[dev:vite              ]     at async loadAndTransform (file:///Users/komodo/Development/komodo-book/node_modules/.pnpm/vite@4.4.11_@types+node@20.11.16_sass@1.62.1/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:54943:24)
[dev:vite              ]
[dev:vite              ] Node.js v20.11.1
[dev:vite              ]  ELIFECYCLE  Command failed with exit code 1.
[dev:typed-scss-modules]  ELIFECYCLE  Command failed.
[dev:typed-scss-modules]  ELIFECYCLE  Command failed.
@mseeley
Copy link
Author

mseeley commented Jun 6, 2024

Changing createViteContext to use server.ws instead of server.hot restored functionality

@posva
Copy link
Owner

posva commented Jun 7, 2024

I see, this API is new in Vite 5, I changed it because of the deprecation message

@posva
Copy link
Owner

posva commented Jun 7, 2024

Apparently they deprecated hot now, so going back to ws will work for both vite versions ✨

@posva posva closed this as completed in 10b3842 Jun 7, 2024
@mseeley
Copy link
Author

mseeley commented Jun 7, 2024

Thank you very much @posva!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants