-
Notifications
You must be signed in to change notification settings - Fork 816
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
=4.36.0
Current Behavior
Since Stencil 4.36.0, an initial prop value can be undetected on a dynamically set Angular component.
For example, I use the following code to emulate the dynamic first
prop value:
<my-component [first]="'issue'"></my-component>
I have the following logs:
@Prop() first!: string;
@Watch('first')
firstChanged() {
console.log('CHANGE', this.first);
}
connectedCallback() {
console.log('connectedCallback', this.first);
}
componentWillLoad() {
console.log('componentWillLoad', this.first);
}
componentDidLoad() {
console.log('componentDidLoad', this.first);
}
render() {
console.log('render', this.first);
...
}
In runtime:

The value comes only at the second rendering, the prop has not been initialized before componentWillLoad
and the Watch()
method has not been called.
The prop update seems to be undetected but fire a rerender.
Note: I reproduced this issue only when the component is on a child routing page and when the app is loaded on this page (See reproduction steps).
Expected Behavior
The prop is available on componentWillLoad
OR the Watch()
method is called.
System Info
System: node 20.18.3
Platform: darwin (24.6.0)
CPU Model: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 cpus)
Compiler: /stencil-demo/packages/elements/node_modules/@stencil/core/compiler/stencil.js
Build: 1752598220
Stencil: 4.36.0 🎊
TypeScript: 5.5.4
Rollup: 4.34.9
Parse5: 7.2.1
jQuery: 4.0.0-pre
Terser: 5.37.0
Steps to Reproduce
- Clone the
angular-issue
branch from https://github.com/mamillastre/stencil-demo/tree/angular-issue - In the root folder
npm i
npm run angular
- Open the running Angular app
- Open the dev console to see the logs
- Click on the "TEST" link
- Here the
Watch()
method is called

- Refresh the page (on the test page)
- The
Watch()
method is not called

If the stencil component is in the Angular root component (projects/angular-app/src/app/app.component.html
), the prop is initialized on componentWillLoad
.

Code Reproduction URL
https://github.com/mamillastre/stencil-demo/tree/angular-issue
Additional Information
The issue seems to come from Stencil v3.36.0.
Workaround: stay on the v3.35.3
I didn't try to reproduce on Vue or React.