Skip to content

namedLayoutSlots: named slots are silently dropped when a page renders without a layout #30

Open

Description

@ExEr7um

Split out of #29.

LayoutSlotsForward renders only ctx.slots.default, so when there is no registry above the page, everything it declares for the layout disappears — no error, no warning, the markup is just not in the tree.

This mostly hurts unit tests: mountSuspended(Page) renders a page outside NuxtLayout, so a page test silently sees less than production. Today the only way around that is to build a registry host by hand in every spec.

Inlining the slots in the page was the wrong fix, as you said in #29. Maybe this belongs in @nuxt/test-utils instead — something that kicks in only when namedLayoutSlots is enabled and mounts a page the way the app renders it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions