Skip to content

toSignal's runtime error message does not get tree shaken away in prod build  #57034

@Totati

Description

@Totati

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

core

Is this a regression?

No

Description

Creating a prod build of an app that uses toSignal keeps the error message of the runtime exception.
image

(typeof ngDevMode === 'undefined' || ngDevMode) &&

is missing from the source code.

Please provide a link to a minimal reproduction of the bug

'`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.',

Please provide the exception or error you saw

No response

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

Angular CLI: 18.0.6
Node: 20.11.0
Package Manager: npm 10.7.0
OS: win32 x64

Angular: 18.0.5
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.6
@angular-devkit/build-angular   18.0.6
@angular-devkit/core            18.0.6
@angular-devkit/schematics      18.0.6
@angular/cli                    18.0.6
@schematics/angular             18.0.6
ng-packagr                      18.0.0
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.4

Anything else?

As it has a comment "// This shouldn't really happen because the error is thrown on creation.", it's really just unnecessary characters.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions