You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
cc @sheremet-va. I'm not sure if this is something we had always guaranteed. You can also manually do import.meta.hot?.accept.bind(import.meta.hot) to make it work for Vite 5. If we want to support it, we'd also do the bind manually internally. And as shown in #15610, binding is expensive especially that it'll apply to all files that uses the HMR API.
Describe the bug
Basically I've been doing HMR for a component like this:
But since v5 the "accept" function relies on "this", which is not preserved the way I was using it, so it breaks.
Reproduction
https://github.com/utrolig/voby-vite-error
Steps to reproduce
npm i && npm run dev
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: