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

ContentSlot gives props "accessed during render but not defined on instance" warnings, breaks content loading #2610

Open
nilsso opened this issue Apr 11, 2024 · 0 comments · May be fixed by #2632

Comments

@nilsso
Copy link

nilsso commented Apr 11, 2024

Environment

  • Operating System: Darwin
  • Node Version: v21.2.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: pnpm@8.10.5
  • Builder: -
  • User Config: devtools, runtimeConfig, modules, content, css
  • Runtime Modules: @nuxt/content@2.12.1, @nuxt/ui@2.15.1
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-5g5ph1?file=pages%2F%5B...slug%5D.vue

Describe the bug

Even the most basic of ContentSlot usage causes a slue of Vue warnings of properties "accessed during render but not defined on instance" and seems to prevent page change content from loading.

Additional context

MRE defines a simple context component.

// @/components/content/Card.vue
<template>
  <div class="border rounded">
    <content-slot :use="$slots.default" unwrap="p" />
    <!-- <slot /> -->
  </div>
</template>

Used in page content

<!-- @/content/index.md -->
::card
Foo
::

Replacing <content-slot :use="$slot.default"> with <slot /> and everything works fine.

Logs

WARN  [Vue warn]: Property "class" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Property "style" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Property "key" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Property "ref" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Property "ref_key" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Property "ref_for" was accessed during render but is not defined on instance.
WARN  [Vue warn]: Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.
@farnabaz farnabaz linked a pull request May 8, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant