Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/vite/src/module-runner/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ export class ModuleRunner {

if (importee) importers.add(importee)

// check circular dependency
// fast path: already evaluated modules can't deadlock
if (mod.evaluated && mod.promise) {
return this.processImport(await mod.promise, meta, metadata)
}

// check circular dependency (only for modules still being evaluated)
if (
callstack.includes(moduleId) ||
this.isCircularModule(mod) ||
Expand All @@ -207,7 +212,7 @@ export class ModuleRunner {
}

try {
// cached module
// cached module (in-progress, not yet evaluated)
if (mod.promise)
return this.processImport(await mod.promise, meta, metadata)

Expand Down