Skip to content

ERROR RuntimeError: NG0600: Writing to signals is not allowed in a computed. #59864

@KibetMasiror

Description

@KibetMasiror

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

core

Is this a regression?

Yes

Description

ERROR RuntimeError: NG0600: Writing to signals is not allowed in a computed.

dialog = signal(false)

openDialog(action: ') {
    this.dialog.update(action => action = !action)
  }

Please provide a link to a minimal reproduction of the bug

Updating a writableSignal using update() throws the error: NG0600: Writing to signals is not allowed in a computed.

Please provide the exception or error you saw

quadrants.component.ts:42 ERROR RuntimeError: NG0600: Writing to signals is not allowed in a `computed`.

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

Angular CLI: 19.1.4
Node: 20.13.0
Package Manager: npm 10.5.2
OS: win32 x64

Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.4
@angular-devkit/build-angular   19.1.4
@angular-devkit/core            19.1.4
@angular-devkit/schematics      19.1.4
@angular/cli                    19.1.4
@schematics/angular             19.1.4
rxjs                            7.8.1
typescript                      5.6.3

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions