Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullInjectorError in combination with standAlone is very unclear? #55304

Open
LanderBeeuwsaert opened this issue Apr 11, 2024 · 3 comments
Open
Labels
area: core Issues related to the framework runtime cross-cutting: standalone Issues related to the NgModule-less world
Milestone

Comments

@LanderBeeuwsaert
Copy link

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

compiler-cli, compiler, core

Is this a regression?

Yes

Description

We're looking into moving to standalone, but while doing that, components that aren't provided the correct tokens are very hard to debug:
image
sending us on wild goose chases providing anything & the kitchen sink to find out what's actually wrong

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

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

Angular CLI: 17.3.3
Node: 20.10.0
Package Manager: npm 9.8.1
OS: win32 x64

Angular: 17.3.3
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, google-maps, language-service, material
... material-date-fns-adapter, platform-browser
... platform-browser-dynamic, router, service-worker
... youtube-player

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.3
@angular-devkit/build-angular   17.3.3
@angular-devkit/core            17.3.3
@angular-devkit/schematics      17.3.3
@angular/fire                   17.0.1
@schematics/angular             17.3.3
rxjs                            7.8.1
typescript                      5.4.4
zone.js                         0.14.4

Anything else?

No response

@JeanMeche
Copy link
Member

Hi, the error log is from a prod build. You should run you app in dev mode for more informations on the issue.

@pkozlowski-opensource pkozlowski-opensource added needs reproduction This issue needs a reproduction in order for the team to investigate further area: core Issues related to the framework runtime labels Apr 11, 2024
@ngbot ngbot bot added this to the Backlog milestone Apr 11, 2024
@pkozlowski-opensource pkozlowski-opensource added cross-cutting: standalone Issues related to the NgModule-less world and removed needs reproduction This issue needs a reproduction in order for the team to investigate further labels Apr 11, 2024
@ngbot ngbot bot modified the milestones: Backlog, needsTriage Apr 11, 2024
@LanderBeeuwsaert
Copy link
Author

I just double-checked, I'm confident this is the build configuration:
image
and also confident it doesn't enable prod mode:
image

and it says so even in devtools angular is in development mode 3 lines above:
image

that should be dev mode then right? I'm missing something obvious?

@JoostK
Copy link
Member

JoostK commented Apr 11, 2024

All Angular symbols are not minified, it's just the _a identifier that appears to be minified, so this is indeed a development build.

You may be able to figure out what _a is by clicking on the fac.js:1:1 link at the bottom of the stack trace in the error. Alternatively, setting a debugger statement at the place where the error is thrown (click the core.mjs:1654:27 link at the top of the stack trace) and reloading the page would allow you to inspect the stack trace interactively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues related to the framework runtime cross-cutting: standalone Issues related to the NgModule-less world
Projects
None yet
Development

No branches or pull requests

4 participants