From 2ef9c975a11436075b0912d3169d223394f1b052 Mon Sep 17 00:00:00 2001 From: underfin Date: Wed, 2 Sep 2020 19:55:46 +0800 Subject: [PATCH] fix(runtime-core): `defineAsyncComponent` should resolve common js module during ssr fix #https://github.com/vitejs/vite/issues/764 --- packages/runtime-core/src/apiAsyncComponent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/apiAsyncComponent.ts b/packages/runtime-core/src/apiAsyncComponent.ts index 3f668a46242..44a4de73b42 100644 --- a/packages/runtime-core/src/apiAsyncComponent.ts +++ b/packages/runtime-core/src/apiAsyncComponent.ts @@ -91,7 +91,9 @@ export function defineAsyncComponent< // interop module default if ( comp && - (comp.__esModule || comp[Symbol.toStringTag] === 'Module') + (__NODE_JS__ || + comp.__esModule || + comp[Symbol.toStringTag] === 'Module') ) { comp = comp.default }