Angular AOT server doesn't play nicely with Bazel for LocationUpgradeModule
See original GitHub issue๐ bug report
Affected Package
The issue is caused by the interaction of @angular/common/upgrade
with the Bazel based AOT compiler.
Is this a regression?
No, this has not worked in any older versions.
Description
When you attempt to import `LocationUpgradeModule.config()` as a dependency you get a difficult error message that doesn't quite scan for me.๐ฌ Minimal Reproduction
Iโve created a repo that has an approximately minimal reproduction. In this commmit I start loading LocationUpgradeModule.config()
and UpgradeModule
in my AppModule
. However, when I add this, I get the following exception.
๐ฅ Exception or Error
Loading: 0 packages loaded
Analyzing: 14 targets (0 packages loaded, 0 targets configured)
INFO: Analyzed 14 targets (0 packages loaded, 0 targets configured).
INFO: Found 14 targets...
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
[1 / 39] Compiling Angular templates (ngc) //my-app/src:src; 1s worker ... (2 actions running)
ERROR: /home/achew22/Projects/angular-bazel-demo/my-app/src/BUILD.bazel:27:1: Compiling Angular templates (ngc) //my-app/src:src failed (Exit 1)
Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'LocationUpgradeModule' was called.
: Unexpected value 'undefined' imported by the module 'AppModule in /home/achew22/.cache/bazel/_bazel_achew22/e93e1b7ac2af1e379678c6e725b6b9dc/execroot/project/my-app/src/app/app.module.ts'
Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'LocationUpgradeModule' was called.
INFO: Elapsed time: 6.126s, Critical Path: 5.22s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
๐ Your Environment
Angular Version:
I donโt think ng version
is the correct dep version, but I do have
"@angular/bazel": "~8.1.0",
in my package.json
, which I believe is the information you want.
Things Iโve done to try to fix it
I tried running this outside of the sandbox to see if that helped (it didnโt), and I also tried turning on trace
which didnโt print any additional output. I would love to debug this myself, but I donโt know how to even manipulate at the abstraction layer where this is happening. Sorry.
Anything else relevant?
@gregmagolan and @alexeagle since I think they are working on Angular/Bazel.
Thanks so much!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
I can confirm that installing
@angular/upgrade
and then removingfrom the
angular-metadata.tsconfig.json
file does allow the installation and thenng build
to complete successfully.This seems like the right approach here.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.