Skip to content

bootstrapApplication does not reject when error is throw in a module which is used in importProvidersFrom function. #49923

@marcincichocki

Description

@marcincichocki

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

core, platform-browser

Is this a regression?

No

Description

In non standalone world it was possible to catch errors during bootstrap by catching rejected promise returned by bootstrapModule method. Trying to do the same in the standalone version, it doesn't work anymore. Errors are ignored somehow, and promise returned by bootstrapApplication never rejects.

Important to note is that this behavior is only happening when module is used within importProvidersFrom function.

Please uncomment line 27-29 to see the problem, catch callback is never executed. It is executed when module is imported inside a component's imports array.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-dc8jfe?file=src/main.ts

Please provide the exception or error you saw

n/a

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

stackblitz has all information.

Anything else?

No response

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimecore: bootstrapcross-cutting: standaloneIssues related to the NgModule-less worldstate: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions