Skip to content

Commit d9e1419

Browse files
authoredJun 16, 2023
fix(browser): access __vi_inject__ only if it was injected (#3587)
1 parent 24ec85a commit d9e1419

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎packages/browser/src/client/index.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
if (module instanceof Promise) {
3434
moduleCache.set(module, { promise: module, evaluated: false })
3535
return module
36-
.then(m => m.__vi_inject__)
36+
// TODO: add a test
37+
.then(m => '__vi_inject__' in m ? m.__vi_inject__ : m)
3738
.finally(() => moduleCache.delete(module))
3839
}
39-
return module.__vi_inject__
40+
return '__vi_inject__' in module ? module.__vi_inject__ : module
4041
}
4142

4243
function exportAll(exports, sourceModule) {

0 commit comments

Comments
 (0)
Please sign in to comment.