Fix Vite race condition (#1674)

This commit is contained in:
Matthew Phillips 2021-10-27 11:45:37 -04:00 committed by GitHub
parent 62684dbe4b
commit 8c4720db3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66472,13 +66472,14 @@ async function instantiateModule(url, server, context = { global }, urlStack = [
if (pendingDeps.length === 1) {
pendingImports.set(url, pendingDeps);
}
await ssrLoadModule(dep, server, context, urlStack);
let val = await ssrLoadModule(dep, server, context, urlStack);
if (pendingDeps.length === 1) {
pendingImports.delete(url);
}
else {
pendingDeps.splice(pendingDeps.indexOf(dep), 1);
}
return val;
}
return (_b = moduleGraph.urlToModuleMap.get(dep)) === null || _b === void 0 ? void 0 : _b.ssrModule;
};