Disable HMR in SSR mode? #1370
Rich-Harris
started this conversation in
Ideas
Replies: 2 comments
-
Oh — I also noticed that /import\s*\.\s*meta/.test(code) PR inbound |
Beta Was this translation helpful? Give feedback.
0 replies
-
both suggestions seem valuable, added in a quick PR: #1372 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the process of testing
import.meta.env.SSR
, I found that Snowpack injects code like the following if it seesimport.meta
:After patching our SSR module loader to accommodate
import.meta
, I realised that this doesn't work in the SSR context becausehmr-client.js
assumes that it's running in the DOM.I see two possible solutions:
isHMR
option toloadUrl
so it can be explicitly disabledisSSR
, by tweaking this line:Beta Was this translation helpful? Give feedback.
All reactions