Skip to content

HMR reloads whole app, loosing all state. #1846

Answered by DreierF
snuup asked this question in Troubleshooting
Discussion options

You must be logged in to vote

Snowpack implements the ESM-HMR standard which is defined here. As illustrated in the examples you need to call import.meta.hot.accept to receive updated modules and have to take care to apply them to your app including state restoration. If none of your modules explicitly handles the update, Snowpack falls back to a page refresh.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by snuup
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants