Skip to content

Commit 5a413a7

Browse files
author
Ives van Hoorne
committed
Fix untranspiled empty.js
1 parent 580729d commit 5a413a7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export default async function fetchModule(
313313

314314
if (foundPath === '//empty.js') {
315315
return {
316-
path: '//empty.js',
316+
path: '/node_modules/empty/index.js',
317317
code: 'module.exports = {};',
318318
requires: [],
319319
};

packages/app/src/sandbox/eval/transpiled-module.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ export default class TranspiledModule {
633633

634634
evaluate(manager: Manager, { asUMD = false }: { asUMD: boolean } = {}) {
635635
if (this.source == null) {
636+
if (this.module.path === '/node_modules/empty/index.js') {
637+
return {};
638+
}
636639
// This scenario only happens when we are in an inconsistent state, the quickest way to solve
637640
// this state is to just hard reload everything.
638641
manager.clearCache();

0 commit comments

Comments
 (0)