Skip to content

Commit 04a6152

Browse files
committed
fix: revert throw when refresh runtime is loaded twice
1 parent 8c33a92 commit 04a6152

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
Revert the throw when refresh runtime is loaded twice to enable usage in micro frontend apps. This was added to help fix setup usage, and this is not worth an annoying warning for others or a config parameter.
6+
7+
This revert was done in the Babel plugin last year and I didn't port it back.
8+
59
## 3.7.1
610

711
Ignore directive sourcemap error [#231](https://github.com/vitejs/vite-plugin-react-swc/issues/231)

Diff for: src/refresh-runtime.js

-6
Original file line numberDiff line numberDiff line change
@@ -547,12 +547,6 @@ 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-
556550
export function getRefreshReg(filename) {
557551
return (type, id) => register(type, filename + " " + id);
558552
}

0 commit comments

Comments
 (0)