From a28a16abcdb90bc71433675b05bc922489f70e0e Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:17:39 +0200 Subject: [PATCH] Fix `Cannot find module` error message --- .../js/src/shared/runtime-utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts b/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts index b79197790fd74..9801467cb67ef 100644 --- a/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts +++ b/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts @@ -264,7 +264,7 @@ function moduleContext(map: ModuleContextMap): ModuleContext { return map[id].module(); } - const e = new Error(`Cannot find module '${name}'`); + const e = new Error(`Cannot find module '${id}'`); (e as any).code = "MODULE_NOT_FOUND"; throw e; } @@ -278,7 +278,7 @@ function moduleContext(map: ModuleContextMap): ModuleContext { return map[id].id(); } - const e = new Error(`Cannot find module '${name}'`); + const e = new Error(`Cannot find module '${id}'`); (e as any).code = "MODULE_NOT_FOUND"; throw e; };