From 325c6b8feaaba6346c05812876143cecd9699d14 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 28 Apr 2021 17:37:35 +0200 Subject: [PATCH] chore(nitro): avoid optional chaining due to wrangler issue https://github.com/nuxt/framework/issues/97 --- packages/nitro/src/runtime/app/vue2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nitro/src/runtime/app/vue2.ts b/packages/nitro/src/runtime/app/vue2.ts index dda7de641e..735e190d66 100644 --- a/packages/nitro/src/runtime/app/vue2.ts +++ b/packages/nitro/src/runtime/app/vue2.ts @@ -8,7 +8,7 @@ const __VUE_SSR_CONTEXT__ = globalThis.__VUE_SSR_CONTEXT__ = {} export function renderToString (component, context) { return new Promise((resolve, reject) => { _renderer.renderToString(component, context, (err, result) => { - const styles = [__VUE_SSR_CONTEXT__, context].map(c => c?._styles?.default).filter(Boolean) + const styles = [__VUE_SSR_CONTEXT__, context].map(c => c && c._styles && c._styles.default).filter(Boolean) if (!context._styles) { context._styles = {} } context._styles.default = { ids: [...styles.map(s => s.ids)],