Skip to content

Commit 28a06d2

Browse files
huntiefacebook-github-bot
authored andcommitted
Add additional help guidance on HMRClient close event
Summary: Resolves [comment on #35514](#35514 (comment)). Changelog: [Internal] Reviewed By: arushikesarwani94 Differential Revision: D42166587 fbshipit-source-id: bb9a28874727e7df45a73d86a876b3d6febe70da
1 parent daeee2a commit 28a06d2

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Libraries/Utilities/HMRClient.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,18 @@ Error: ${e.message}`;
252252
closeEvent.code === 1005 ||
253253
closeEvent.code == null;
254254

255-
if (isNormalOrUnsetCloseReason) {
256-
setHMRUnavailableReason('Disconnected from Metro.');
257-
} else {
258-
setHMRUnavailableReason(
259-
`Disconnected from Metro (${closeEvent.code}: "${closeEvent.reason}").`,
260-
);
261-
}
255+
setHMRUnavailableReason(
256+
`${
257+
isNormalOrUnsetCloseReason
258+
? 'Disconnected from Metro.'
259+
: `Disconnected from Metro (${closeEvent.code}: "${closeEvent.reason}").`
260+
}
261+
262+
To reconnect:
263+
- Ensure that Metro is running and available on the same network
264+
- Reload this app (will trigger further help if Metro cannot be connected to)
265+
`,
266+
);
262267
});
263268

264269
if (isEnabled) {

0 commit comments

Comments
 (0)