Skip to content

Commit 0e1b211

Browse files
author
Ives van Hoorne
committed
Fix async downloaded browser stubbed module in evaluation phase
Fixes codesandbox#955
1 parent 2df3f4a commit 0e1b211

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/app/src/sandbox/eval/npm/fetch-npm-module.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@ export default async function fetchModule(
311311
);
312312

313313
if (foundPath === '//empty.js') {
314+
// Mark the path of the module as the real module, because during evaluation
315+
// we don't have meta to find which modules are browser modules and we still
316+
// need to return an empty module for browser modules.
314317
return {
315-
path: '/node_modules/empty/index.js',
318+
path: pathUtils.join(currentPath, path),
316319
code: 'module.exports = {};',
317320
requires: [],
318321
};

0 commit comments

Comments
 (0)