We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca785b6 commit 13cd4a4Copy full SHA for 13cd4a4
packages/plugin-react/src/refreshUtils.js
@@ -1,3 +1,13 @@
1
+/* eslint-disable no-undef */
2
+if (typeof window !== 'undefined') {
3
+ if (window.__vite_plugin_react_runtime_loaded__) {
4
+ throw new Error(
5
+ 'React refresh runtime was loaded twice. Maybe you forgot the base path?',
6
+ )
7
+ }
8
+ window.__vite_plugin_react_runtime_loaded__ = true
9
+}
10
+
11
function debounce(fn, delay) {
12
let handle
13
return () => {
@@ -6,7 +16,6 @@ function debounce(fn, delay) {
16
}
17
18
-/* eslint-disable no-undef */
19
const enqueueUpdate = debounce(exports.performReactRefresh, 16)
20
21
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
0 commit comments