nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3k stars 605 forks source link

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

Closed nilsso closed 1 month ago

nilsso commented 2 months ago

Environment

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.