Commit f109c0a
Skip HMR client setup when bundle is not from Metro (#58428)
Summary:
Pull Request resolved: #58428
When the JS bundle is loaded from a local file (bundled with the app or restored from disk), `HMRClient.setup()` still runs during startup and registers an entry-point with the packager over the fallback `/hot?bundleEntry=...` URL. There is no coherent module map to hot-reload against, so the packager side logs an "Unable to resolve module" error.
Gate `setup()` on `getDevServer().bundleLoadedFromServer` and early-return with a `console.warn` when the bundle did not come from Metro. The user still sees why HMR is unavailable in this session, but the noisy resolver error goes away.
Changelog:
[General][Fixed] - Skip HMR client setup when the JS bundle was not loaded from Metro
Reviewed By: vzaidman
Differential Revision: D110603320
fbshipit-source-id: 63a3c19d886598bc934c9bbdd90b32a8eb8d5aad1 parent 506165d commit f109c0a
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
165 | 177 | | |
166 | 178 | | |
167 | 179 | | |
| |||
0 commit comments