We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bdf123f commit 91ea1eaCopy full SHA for 91ea1ea
1 file changed
packages/runtime/assets/harness-module-system.js
@@ -102,6 +102,16 @@
102
}
103
104
newMod.isInitialized = false;
105
+ // Reset publicModule.exports to ensure a clean start
106
+ // This is crucial because if we reuse the old exports object,
107
+ // the module factory might append to it instead of overwriting it,
108
+ // or we might be left with stale state (e.g., class definitions)
109
+ newMod.publicModule = { exports: {} };
110
+
111
+ // Also clear error state
112
+ newMod.hasError = false;
113
+ newMod.error = undefined;
114
115
modules.set(moduleId, newMod);
116
117
});
@@ -116,4 +126,4 @@
126
: typeof window !== 'undefined'
127
? window
118
128
: this
119
-);
129
+);
0 commit comments