Skip to content

bug: TypeError: Cannot read properties of null (reading 'nodeType') is still happening in the latest version #6396

@VZinii

Description

@VZinii

Prerequisites

Stencil Version

4.37.1

Current Behavior

I found an existing issue about the TypeError: Cannot read properties of null (reading 'nodeType') error. A fix for it was released in version 4.25.1, but the error is still happening in the latest version when taskQueue="immediate" is set and a prop has {reflect: true}.

I published a demo on Vercel: https://stencil-demo-issue.vercel.app

Image

Expected Behavior

Not throwing NodeType error with this project configuration

System Info

System: node 22.14.0
Platform: linux (6.8.0-83-generic)
CPU Model: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 cpus)
Compiler: /home/vitor.zini/Documentos/Sandbox/my-stencil-project/node_modules/.pnpm/@stencil+core@4.37.1/node_modules/@stencil/core/compiler/stencil.js
Build: 1758315275
Stencil: 4.37.1 🏰
TypeScript: 5.5.4
Rollup: 4.34.9
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0

Steps to Reproduce

  1. Create a new component.
  2. Set a prop with {reflect: true}
  3. Set taskQueue to "immediate"
  4. Create a click listener that changes the prop's value: If the prop has a value, set it to undefined. If not, assign a value to it.

After that, each click should trigger the NodeType error.

Code Reproduction URL

https://github.com/VZinii/stencil-demo-issue

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: ValidatedThis PR or Issue is verified to be a bug within StencilHelp Wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions