Skip to content

[🐞] v2: ownerDocument is null during deserialization #7805

@thejackshelton

Description

@thejackshelton

Which component is affected?

Qwik Runtime

Describe the bug

When clicking the "Next" button in a user created pagination component, a runtime error occurs during text node inflation:

Root Cause

The error occurs in Qwik's vnode_ensureTextInflated function when trying to access parentNode.ownerDocument during DOM deserialization. The ownerDocument property is null when the pagination state changes.

Environment

  • Qwik v2.0.0-beta.7
  • Package Manager: pnpm
  • SSR mode (pnpm dev runs with --mode ssr)
  • Pagination component with conditional rendering and text content

Core API's used:

  • Pagination uses context
  • PaginationItem with conditional rendering based on computed signals
  • PaginationNext that updates the selectedPage signal on click
  • Text content within Slot components that triggers text node inflation
  • A render component primitive for composition

Reproduction

https://github.com/thejackshelton/v2-owner-document-repro

Steps to reproduce

  1. Install dependencies: pnpm install
  2. Start development server: pnpm dev (SSR mode)
  3. Load the page with pagination component
  4. Click the "Next" button
  5. Error occurs during DOM text node inflation/deserialization

Technical Details

The error happens in this code path:

const doc = parentNode.ownerDocument; // parentNode.ownerDocument is null

System Info

System:
    OS: macOS 15.5
    CPU: (16) arm64 Apple M4 Max
    Memory: 201.50 MB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
    pnpm: 10.14.0 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
    bun: 1.1.7 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 135.1.77.95
    Chrome: 138.0.7204.185
    Safari: 18.5
  npmPackages:
    typescript: 5.4.5 => 5.4.5 
    undici: * => 7.13.0 
    vite: 7.1.1 => 7.1.1

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions