Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Signal forms: CVA interop fails if CVA uses signals #64614

Copy link
Copy link
@cexbrayat

Description

@cexbrayat
Issue body actions

Which @angular/* package(s) are the source of the bug?

forms

Is this a regression?

Yes

Description

Using a signal inside a CVA to store the edited value throws NG0600 if the CVA is used with a Field.

This can be easily reproduced by updating the interop.spec.ts in the Angular repo to use a value signal, and run bazel test //packages/forms/signals/test/web:test_chromium

or in the Stackblitz below

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-anhs8wzj?file=src%2Fmain.ts

Please provide the exception or error you saw

Error: NG0600: Writing to signals is not allowed while Angular renders the template (eg. interpolations)
      
        at packages/core/src/application/application_ref.ts:86:10
        at throwInvalidWriteToSignalError (packages/core/primitives/signals/src/errors.ts:18:2)
        at signalSetFn (packages/core/primitives/signals/src/signal.ts:88:4)
        at getter.set (packages/core/primitives/signals/src/signal.ts:70:31)
        at CustomControl.writeValue (packages/forms/signals/test/web/interop.spec.ts:41:17)
        at Field.ɵinteropControlUpdate (packages/forms/signals/src/api/field_directive.ts:98:25)
        at ɵɵcontrol (packages/core/src/render3/instructions/control.ts:89:14)
        at TestCmp_Template2 (packages/forms/signals/test/web/interop.spec.ts:121:33)
        at executeTemplate (packages/core/src/render3/instructions/shared.ts:109:4)
        at refreshView (packages/core/src/render3/instructions/change_detection.ts:232:6)

Please provide the environment you discovered this bug in (run ng version)

Angular CLI       : 21.0.0-next.8
Angular           : 21.0.0-next.9
Node.js           : 20.19.1
Package Manager   : npm 10.8.2
Operating System  : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/animations       │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/build            │ 21.0.0-next.8     │ 21.0.0-next.8     │
│ @angular/cli              │ 21.0.0-next.8     │ 21.0.0-next.8     │
│ @angular/common           │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/compiler         │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/compiler-cli     │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/core             │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/forms            │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/platform-browser │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ @angular/router           │ 21.0.0-next.9     │ 21.0.0-next.9     │
│ rxjs                      │ 7.8.2             │ ^7.8.1            │
│ typescript                │ 5.9.3             │ ^5.8.2            │
│ zone.js                   │ 0.15.0            │ ~0.15.0           │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.