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

Setting selectiveClient: 'deep' breaks components with conditional slots #26361

Closed
brc-dd opened this issue Mar 19, 2024 · 1 comment · Fixed by #26386
Closed

Setting selectiveClient: 'deep' breaks components with conditional slots #26361

brc-dd opened this issue Mar 19, 2024 · 1 comment · Fixed by #26386

Comments

@brc-dd
Copy link

brc-dd commented Mar 19, 2024

Environment

  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.11.1
  • CLI Version: 3.11.0
  • Nitro Version: 2.9.4
  • Package Manager: npm@10.2.3
  • Builder: -
  • User Config: experimental
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-romtaf

Describe the bug

Setting componentIslands.selectiveClient to deep currently breaks things like conditionally rendered slots because the transform isn't handling directives properly. It's transforming v-if="foo" to :props="[{ v-if: `foo` }]"

Additional context

Also, if I refactor to template + v-if + slot (https://stackblitz.com/edit/github-romtaf-cwixc1), I'm getting warnings like WARN [Vue warn]: Extraneous non-props attributes (data-v-875a1e80) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. However, there is no warning if I don't enable that option.

Logs

[vite-node] [plugin:vite:vue] [SyntaxError] ./components/Foo.vue:6:0

<script setup lang="ts">
import { vforToArray as __vforToArray } from '#app/components/utils'
import NuxtTeleportIslandComponent from '#app/components/nuxt-teleport-island-component'
import NuxtTeleportSsrSlot from '#app/components/nuxt-teleport-island-slot'
const foo = true;
</script>

<template>
  <NuxtTeleportSsrSlot name="default" :props="[{ v-if: `foo` }]"><slot v-if="foo" /></NuxtTeleportSsrSlot>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants