diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts index 3562c6cabe..fe4ba0859d 100644 --- a/packages/nuxt/src/core/runtime/nitro/renderer.ts +++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts @@ -83,7 +83,10 @@ const getSPARenderer = lazyCachedFunction(async () => { if ('all' in clientManifest && 'initial' in clientManifest) { // Upgrade legacy manifest (also see normalizeClientManifest in vue-bundle-renderer) // https://github.com/nuxt-contrib/vue-bundle-renderer/issues/12 - entryFiles = clientManifest.initial.map(file => ({ file })) + entryFiles = clientManifest.initial.map(file => + // Webpack manifest fix with SPA renderer + file.endsWith('css') ? { css: file } : { file } + ) } return Promise.resolve({ @@ -97,6 +100,7 @@ const getSPARenderer = lazyCachedFunction(async () => { .join(''), renderScripts: () => entryFiles + .filter(({ file }) => file) .map(({ file }) => { const isMJS = !file.endsWith('.js') return `` diff --git a/test/basic.test.ts b/test/basic.test.ts index fefab873f5..5462ded90a 100644 --- a/test/basic.test.ts +++ b/test/basic.test.ts @@ -145,6 +145,12 @@ describe('head tags', () => { // should render
components expect(index).toContain('