Skip to content

Commit 42cecc0

Browse files
committed
fix: don't redefine property
1 parent a7d233c commit 42cecc0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/runtime/src/module/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ class Module {
137137
id: string,
138138
) {
139139
function defineModuleId(res: any, id: string) {
140-
if (res && typeof res === 'object') {
140+
if (
141+
res &&
142+
typeof res === 'object' &&
143+
!Object.getOwnPropertyDescriptor(res, Symbol.for('mf_module_id'))
144+
) {
141145
Object.defineProperty(res, Symbol.for('mf_module_id'), {
142146
value: id,
143147
enumerable: false,

0 commit comments

Comments
 (0)