Skip to content

Commit

Permalink
fix(browser): access __vi_inject__ only if it was injected (#3587)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 16, 2023
1 parent 24ec85a commit d9e1419
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/browser/src/client/index.html
Expand Up @@ -33,10 +33,11 @@
if (module instanceof Promise) {
moduleCache.set(module, { promise: module, evaluated: false })
return module
.then(m => m.__vi_inject__)
// TODO: add a test
.then(m => '__vi_inject__' in m ? m.__vi_inject__ : m)
.finally(() => moduleCache.delete(module))
}
return module.__vi_inject__
return '__vi_inject__' in module ? module.__vi_inject__ : module
}

function exportAll(exports, sourceModule) {
Expand Down

0 comments on commit d9e1419

Please sign in to comment.