diff --git a/packages/sfc-playground/src/sfcCompiler.ts b/packages/sfc-playground/src/sfcCompiler.ts index 09e74805..9f04f251 100644 --- a/packages/sfc-playground/src/sfcCompiler.ts +++ b/packages/sfc-playground/src/sfcCompiler.ts @@ -97,10 +97,11 @@ export async function compileFile({ filename, code, compiled }: File) { // the render fn is inlined. if (descriptor.scriptSetup) { const ssrScriptResult = await doCompileScript(descriptor, id, true) - if (!ssrScriptResult) { - return + if (ssrScriptResult) { + ssrCode += ssrScriptResult[0] + } else { + ssrCode = `/* SSR compile error: ${store.errors[0]} */` } - ssrCode += ssrScriptResult[0] } else { // when no