diff --git a/src/runtime/nitro/plugins/40-cspSsrNonce.ts b/src/runtime/nitro/plugins/40-cspSsrNonce.ts index aa7ee8e8..3d4bc120 100644 --- a/src/runtime/nitro/plugins/40-cspSsrNonce.ts +++ b/src/runtime/nitro/plugins/40-cspSsrNonce.ts @@ -52,6 +52,10 @@ export default defineNitroPlugin((nitroApp) => { const sections = ['body', 'bodyAppend', 'bodyPrepend', 'head'] as Section[] for (const section of sections) { html[section] = html[section].map((element) => { + // Skip non-string elements + if (typeof element !== 'string') { + return element; + } // Add nonce to all link tags element = element.replace(LINK_RE, (match, rest) => { return `