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

fix(compiler-cli): report error when a reference target is missing instead of crashing #39805

Closed
wants to merge 1 commit into from

Conversation

JoostK
Copy link
Member

@JoostK JoostK commented Nov 22, 2020

If a template declares a reference to a missing target then referring to
that reference from elsewhere in the template would crash the template
type checker, due to a regression introduced in #38618. This commit
fixes the crash by ensuring that the invalid reference will resolve to
a variable of type any.

Fixes #39744

…stead of crashing

If a template declares a reference to a missing target then referring to
that reference from elsewhere in the template would crash the template
type checker, due to a regression introduced in angular#38618. This commit
fixes the crash by ensuring that the invalid reference will resolve to
a variable of type any.

Fixes angular#39744
@JoostK JoostK added type: bug/fix action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release engine: ivy area: compiler Issues related to `ngc`, Angular's template compiler P2 The issue is important to a large percentage of users, with a workaround compiler: template type-checking labels Nov 22, 2020
@ngbot ngbot bot added this to the needsTriage milestone Nov 22, 2020
@google-cla google-cla bot added the cla: yes label Nov 22, 2020
@JoostK JoostK marked this pull request as ready for review November 23, 2020 20:53
@JoostK JoostK added action: merge The PR is ready for merge by the caretaker action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Nov 23, 2020
@AndrewKushnir
Copy link
Contributor

Presubmit.

@JoostK
Copy link
Member Author

JoostK commented Nov 24, 2020

I'm running into this same issue after upgrading to ng 11. Is there a way for me to find the reference causing the problem? Or perhaps a way for me to apply this fix to the version of angular I'm running?

@maximodee You could install the build artifacts from this PR:

https://app.circleci.com/pipelines/github/angular/angular/25082/workflows/05b787bb-43f8-4edb-99ce-61f296f5e65b/jobs/865134/artifacts

Here's some instructions. You need at least @angular/compiler and @angular/compiler-cli as those are tightly coupled. These are based on 11.1-next and not 11.0.x, but keeping all other Angular deps at 11.x may work (otherwise also update the rest of the packages to the build artifacts). Please only use it for finding the error, as this is a snapshot build not intended for production usage.

@maximodee
Copy link

maximodee commented Nov 24, 2020 via email

@AndrewKushnir AndrewKushnir removed the action: presubmit The PR is in need of a google3 presubmit label Nov 24, 2020
AndrewKushnir pushed a commit that referenced this pull request Nov 24, 2020
…stead of crashing (#39805)

If a template declares a reference to a missing target then referring to
that reference from elsewhere in the template would crash the template
type checker, due to a regression introduced in #38618. This commit
fixes the crash by ensuring that the invalid reference will resolve to
a variable of type any.

Fixes #39744

PR Close #39805
@ghost
Copy link

ghost commented Nov 25, 2020

Any idea when this fix will be included as part of an update as it's causing major problems trying to debug issues caused by reorganising our modules?

@JoostK
Copy link
Member Author

JoostK commented Nov 25, 2020

@andyb70 it would normally have been today, but there won't be a release this week due to Thanksgiving.

@ghost
Copy link

ghost commented Nov 25, 2020

@JoostK thanks for the feedback, looks like I've got a painful few days ahead of me then!!

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler cla: yes compiler: template type-checking P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ivy (aot) Could not resolve [object Object] / undefined at Scope.resolve
4 participants