diff --git a/packages/vite-node/src/client.ts b/packages/vite-node/src/client.ts index 1ad19588a212..3f2fbc139791 100644 --- a/packages/vite-node/src/client.ts +++ b/packages/vite-node/src/client.ts @@ -188,16 +188,13 @@ export class ViteNodeRunner { if (!mod.importers) mod.importers = new Set() - - const isCircular = mod.importers.has(importee) - if (importee) mod.importers.add(importee) const getStack = () => `stack:\n${[...callstack, fsPath].reverse().map(p => ` - ${p}`).join('\n')}` // check circular dependency - if (isCircular || callstack.includes(fsPath) || callstack.some(c => this.moduleCache.get(c).importers?.has(fsPath))) { + if (callstack.includes(fsPath) || callstack.some(c => this.moduleCache.get(c).importers?.has(fsPath))) { if (mod.exports) return mod.exports }