Skip to content

Commit

Permalink
fix: throw when refresh runtime is loaded twice
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Apr 9, 2023
1 parent 0ed5b22 commit e272817
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/refresh-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,12 @@ function isLikelyComponentType(type) {
* Plugin utils
*/

if (window.$RefreshReg$) {
throw new Error(
"React refresh runtime was loaded twice. Maybe you forgot the base path?",
);
}

export function getRefreshReg(filename) {
return (type, id) => register(type, filename + " " + id);
}
Expand Down

0 comments on commit e272817

Please sign in to comment.