Skip to content

bug: Host value is not updated #6610

@henrijoss

Description

@henrijoss

Prerequisites

Stencil Version

4.43.0

Current Behavior

When setting an optional mutable property to undefined initially, the host value is never updated.

Expected Behavior

Host value is always in sync with prop value.

System Info

Steps to Reproduce

  1. Define mutable optional prop
    @Prop({ mutable: true }) first?: string;

  2. Set prop to undefined initially

const myComponent = document.querySelector("my-component");
myComponent.first = undefined;
  1. Update value of prop internally
    this.first = 'Some value';

  2. Host value was not updated to new value
    this.host.first => still undefined

Code Reproduction URL

https://codesandbox.io/p/github/johnjenkins/stencil-starter/csb-z96sgg/draft/damp-sound

Additional Information

Seems to work in 4.37.1 and breaks starting from version 🎿 4.38.0 (2025-10-02)

Problem seems to also exist when the prop is not mutable and the value is set from outside but the other way around. The internal prop is not updated in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions