Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-side rendering a component with conditional slot causes error #14950

Open
Andersso opened this issue Sep 17, 2022 · 1 comment
Open

Server-side rendering a component with conditional slot causes error #14950

Andersso opened this issue Sep 17, 2022 · 1 comment

Comments

@Andersso
Copy link

Environment

Nuxi 3.0.0-rc.10
RootDir: /sandbox
Nuxt project info:


  • Operating System: Linux
  • Node Version: v14.19.3
  • Nuxt Version: 3.0.0-rc.10
  • Nitro Version: 0.5.3
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/s/dawn-morning-b454k7?file=/pages/index.vue

Juicy bit:
<FooComponent> <template v-if="true" #first> Hello conditional </template> </FooComponent>

Describe the bug

  • When rendering a component slot with a condition that evaluates to true, an error will be thrown, the slot is however rendered correctly.
  • It only seems to happen during SSR.
  • Conditions that evaluates to false does not throw an error

Additional context

In RC 8 this was working fine

Logs

[nitro] [dev] [unhandledRejection] TypeError: Cannot set property 'key' of undefined
    at slots.<computed> (/sandbox/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:2924:29)
    at ssrRenderSlotInner (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:628:21)
    at Module.ssrRenderSlot (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:618:5)
    at _sfc_ssrRender (/sandbox/components/FooComponent.vue:7:25)
    at renderComponentSubTree (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:254:17)
    at renderComponentVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
    at Module.ssrRenderComponent (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:612:12)
    at _sfc_ssrRender (/sandbox/pages/index.vue:60:31)
    at renderComponentSubTree (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:254:17)
    at renderComponentVNode (/sandbox/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:188:16)
Copy link
Member

You can track in vuejs/core#6651.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants