Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit e272817

Browse files
committed
fix: throw when refresh runtime is loaded twice
1 parent 0ed5b22 commit e272817

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/refresh-runtime.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,12 @@ function isLikelyComponentType(type) {
547547
* Plugin utils
548548
*/
549549

550+
if (window.$RefreshReg$) {
551+
throw new Error(
552+
"React refresh runtime was loaded twice. Maybe you forgot the base path?",
553+
);
554+
}
555+
550556
export function getRefreshReg(filename) {
551557
return (type, id) => register(type, filename + " " + id);
552558
}

0 commit comments

Comments
 (0)