Skip to content

Commit bdff045

Browse files
committed
Fix cache reset for empty file of browser-resolve
Fixes codesandbox#938
1 parent ff78f92 commit bdff045

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/app/src/sandbox/eval/manager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ export default class Manager {
491491
const shimmedPath = coreLibraries[aliasedPath] || aliasedPath;
492492

493493
if (NODE_LIBS.includes(shimmedPath)) {
494+
this.cachedPaths[dirredPath][path] = shimmedPath;
494495
return SHIMMED_MODULE;
495496
}
496497

@@ -702,6 +703,7 @@ export default class Manager {
702703
this.getModules().forEach(m => {
703704
if (
704705
!m.path.startsWith('/node_modules') &&
706+
m.path !== '/var/task/node_modules/browser-resolve/empty.js' &&
705707
!modules[m.path] &&
706708
!m.parent // not an emitted module
707709
) {
@@ -841,7 +843,7 @@ export default class Manager {
841843
meta,
842844
}: {
843845
transpiledModules: { [id: string]: SerializedTranspiledModule },
844-
cachedPaths: { [path: string]: string },
846+
cachedPaths: { [path: string]: { [path: string]: string } },
845847
version: string,
846848
timestamp: number,
847849
configurations: Object,

0 commit comments

Comments
 (0)