question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli

Description

this its only in Angular 11.0.0

enable ivy run ng build --aot or "aot": true in angular.json

this same bug 30677

πŸ”₯ Exception or Error



Error: Error: Could not resolve [object Object] / undefined
    at Scope.resolve (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1318:23)
    at TcbEventHandlerTranslator.TcbExpressionTranslator.resolveTarget (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1877:35)
    at TcbEventHandlerTranslator.TcbExpressionTranslator.resolve (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1786:29)
    at TcbEventHandlerTranslator.resolve (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:2034:45)
    at AstTranslator.maybeResolve (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:84)
    at AstTranslator.translate (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:74:33)
    at Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:204:68
    at Array.map (<anonymous>)
    at AstTranslator.visitMethodCall (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:204:33)
    at MethodCall.visit (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler\bundles\compiler.umd.js:8218:28)
    at AstTranslator.translate (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:78:24)
    at Object.astToTypescript (Z:\GIT_LOCAL\tools\CloudTool\CloudWebTool\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:55:27)


🌍 Your Environment

Angular Version:



Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.1
@angular-devkit/build-angular   0.1100.1
@angular-devkit/core            11.0.1
@angular-devkit/schematics      11.0.1
@angular/cli                    11.0.1
@schematics/angular             11.0.1
@schematics/update              0.1100.1
rxjs                            6.6.3
typescript                      4.0.5


Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
JoostKcommented, Nov 22, 2020

I was able to reproduce this error by accidently using a capital β€œF” in a form control… <Form class="login-form" #f="ngForm" (ngSubmit)="onSubmit(f)">

once I changed it to… <form class="login-form" #f="ngForm" (ngSubmit)="onSubmit(f)"> the error went away.

@joebieb Thank you, that has helped in finding the issue. It appears to have regressed in #38618, where referring a reference that is bound to an unknown directive now crashes. Before, it would have reported an error:

ERROR in src/app/app.component.html:1:10 - error NG8003: No directive found with exportAs 'test'.

1 <div #a="test"></div> {{ a() }}
           ~~~~

  src/app/app.component.ts:5:16
    5   templateUrl: './app.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component AppComponent.

I’m working on a fix.

0reactions
angular-automatic-lock-bot[bot]commented, Dec 25, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems with enabling Ivy in Angular 10 - Stack Overflow
We recently updated to angular 10 and enabled Ivy and aot. Now we are running into several problems that we are not able...
Read more >
A Deep Dive into @Injectable and providedIn in Ivy - Angular ...
In this article I want to explain how Angular @Injectable decorator works under the hood and how providedIn property is processed by AngularΒ ......
Read more >
@angular/compiler-cli | Yarn - Package Manager
Angular is a development platform for building mobile and desktop web applications using Typescript/JavaScript and other languages. www.angular.io.
Read more >
Angular Ivy
Ivy is the code name for Angular's next-generation compilation and rendering pipeline. With the version 9 release of Angular, the new compiler and...
Read more >
npm error when publishing after ANZ v10.1 Angular/.Net5 ...
npm run publish ... Error: Error: Could not resolve [object Object] / undefined at Scope.resolve (D:\stepwell-anz\src\Stepwell.Web.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found