From 0af4a9c9612a364ff05036c9760290c461a0798e Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Tue, 9 Aug 2022 15:23:32 -0500 Subject: [PATCH] fix: repl require() core.cjs --- scripts/submodule-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/submodule-server.ts b/scripts/submodule-server.ts index 18201090b14..a8debea6e2d 100644 --- a/scripts/submodule-server.ts +++ b/scripts/submodule-server.ts @@ -127,7 +127,7 @@ const browserCjsRequireShim = ` if (typeof require !== 'function' && typeof location !== 'undefined' && typeof navigator !== 'undefined') { // shim cjs require() for core.cjs within a browser globalThis.require = function(path) { - if (path === './core.cjs') { + if (path === './core.cjs' || path === '@builder.io/qwik') { if (!self.qwikCore) { throw new Error('Qwik Core global, "globalThis.qwikCore", must already be loaded for the Qwik Server to be used within a browser.'); }