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.

Getting exception after converting to angular 9 from angular 7 while running ng build --prod --aot=true

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/....

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

without --aot its working fine but when running ng build --aot its showing me error

πŸ”¬ Minimal Reproduction

"dependencies": {
    "@angular/animations": "9.1.1",
    "@angular/cdk": "9.2.0",
    "@angular/common": "9.1.1",
    "@angular/compiler": "9.1.1",
    "@angular/core": "9.1.1",
    "@angular/flex-layout": "9.0.0-beta.29",
    "@angular/forms": "9.1.1",
    "@angular/localize": "^9.0.7",
    "@angular/material": "9.2.0",
    "@angular/material-moment-adapter": "9.2.0",
    "@angular/platform-browser": "9.1.1",
    "@angular/platform-browser-dynamic": "9.1.1",
    "@angular/router": "9.1.1",
    "@fullcalendar/core": "^4.4.0",
    "@ng-bootstrap/ng-bootstrap": "6.0.2",
    "@ngrx/core": "1.2.0",
    "@ngrx/store": "9.1.0",
    "@types/jquery": "3.3.34",
    "@types/jqueryui": "1.12.10",
    "angular-pipes": "10.0.0",
    "angular-prism": "0.1.20",
    "angular-split": "3.0.3",
    "angular2-busy": "2.0.4",
    "angular-gridster2": "9.1.0",
    "angular2-highcharts": "0.5.5",
    "angular2-moment": "1.9.0",
    "big-integer": "1.6.48",
    "chart.js": "^2.9.3",
    "classlist.js": "1.1.20150312",
    "codemirror": "5.52.2",
    "core-js": "3.6.5",
    "d3-ng2-service": "2.2.0",
    "d3-sankey": "0.12.3",
    "d3-tip": "0.9.1",
    "font-awesome": "4.7.0",
    "hammerjs": "2.0.8",
    "highcharts": "8.0.4",
    "highcharts-angular": "2.4.0",
    "html2canvas": "1.0.0-rc.5",
    "immutable": "4.0.0-rc.12",
    "intl": "1.2.5",
    "ip-range-check": "^0.2.0",
    "jquery": "^3.4.1",
    "js-beautify": "1.11.0",
    "js-beautify-sourcemap": "0.2.2",
    "jsencrypt": "3.0.0-rc.1",
    "jsplumb": "2.13.0",
    "lz-string": "1.4.4",
    "moment": "2.24.0",
    "moment-timezone": "0.5.28",
    "ng-block-ui": "2.1.8",
    "ng-sidebar": "9.2.0",
    "ng2-ace-editor": "0.3.9",
    "ng2-codemirror": "1.1.3",
    "ng2-slim-loading-bar": "4.0.0",
    "ngx-clipboard": "^13.0.0",
    "node-sass": "4.13.1",
    "perfect-scrollbar": "1.5.0",
    "primeicons": "2.0.0",
    "primeng": "^9.0.2",
    "quill": "^1.3.7",
    "react-highcharts-no-data-to-display": "1.0.2",
    "react-sparklines": "1.7.0",
    "rxjs": "6.5.5",
    "rxjs-compat": "6.5.5",
    "serializer.ts": "0.0.12",
    "ts-helpers": "1.1.2",
    "tslib": "1.11.1",
    "web-animations-js": "2.3.2",
    "zone.js": "0.10.3",
    "ngx-virtual-scroller": "4.0.3",
    "rx-queue": "^0.8.5",
    "js-yaml": "3.13.1",
    "typescript-collections": "1.3.3"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.901.1",
    "@angular/cli": "9.1.1",
    "@angular/compiler-cli": "9.1.1",
    "@angular/language-service": "9.1.1",
    "@types/highcharts": "7.0.0",
    "@types/jasmine": "3.5.10",
    "@types/jasminewd2": "2.0.8",
    "@types/jsplumb": "2.5.7",
    "@types/lz-string": "1.3.34",
    "@types/moment": "2.13.0",
    "@types/moment-timezone": "0.5.13",
    "@types/node": "13.11.1",
    "codelyzer": "5.2.2",
    "commander": "5.0.0",
    "jasmine-core": "3.5.0",
    "jasmine-spec-reporter": "5.0.1",
    "karma": "^5.0.1",
    "karma-chrome-launcher": "3.1.0",
    "karma-cli": "2.0.0",
    "karma-coverage-istanbul-reporter": "^2.1.1",
    "karma-jasmine": "3.1.1",
    "karma-jasmine-html-reporter": "1.5.3",
    "karma-remap-istanbul": "0.6.0",
    "ngx-color-picker": "9.0.0",
    "ngx-perfect-scrollbar": "9.0.0",
    "protractor": "^5.4.3",
    "ts-node": "8.8.2",
    "tslint": "6.1.1",
    "typescript": "3.8.3"
  }
}

πŸ”₯ Exception or Error

ERROR in Error: Method not implemented.
    at AstTranslator.visitQuote (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:212:69)    


ERROR in Error: Method not implemented.
    at AstTranslator.visitQuote (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:212:69)    
    at Quote.visit (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler\bundles\compiler.umd.js:7451:28)
    at AstTranslator.translate (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:73:24)      
    at Object.astToTypescript (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:50:27)       
    at TcbExpressionTranslator.translate (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1206:33)
    at tcbExpression (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1194:27)        
    at processAttribute (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1466:24)     
    at Array.forEach (<anonymous>)
    at tcbGetDirectiveInputs (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1416:19)
    at TcbDirectiveOp.execute (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:340:26)
    at Scope.executeOp (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:969:26)       
    at Scope.render (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:882:22)
    at Object.generateTypeCheckBlock (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:56:37)
    at TypeCheckFile.addTypeCheckBlock (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_file.js:45:41)
    at TypeCheckContext.addTemplate (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\context.js:109:36)   
    at ComponentDecoratorHandler.typeCheck (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\annotations\src\component.js:379:17)
    at TraitCompiler.typeCheck (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\transform\src\compilation.js:470:43)    
    at NgCompiler.getTemplateDiagnostics (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\core\src\compiler.js:452:39)  
    at NgCompiler.getDiagnostics (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\core\src\compiler.js:132:97)
    at NgtscProgram.getNgSemanticDiagnostics (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@angular\compiler-cli\src\ngtsc\program.js:130:45)        
    at checkDiagnostics (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@ngtools\webpack\src\diagnostics.js:46:27)
    at Object.gatherDiagnostics (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@ngtools\webpack\src\diagnostics.js:85:13)
    at AngularCompilerPlugin._emit (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:1076:54)
    at AngularCompilerPlugin._update (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:867:50)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async AngularCompilerPlugin._make (C:\Users\ajit.kumar\Desktop\ProductUI_19th_march\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:749:13) 

🌍 Your Environment

Angular CLI: 9.1.1 Node: 12.13.1 OS: win32 x64

Angular: 9.1.1 … animations, cli, common, compiler, compiler-cli, core, forms … language-service, localize, platform-browser … platform-browser-dynamic, router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.1 @angular-devkit/build-angular 0.901.1 @angular-devkit/build-optimizer 0.901.1 @angular-devkit/build-webpack 0.901.1 @angular-devkit/core 9.1.1 @angular-devkit/schematics 9.1.1 @angular/cdk 9.2.0 @angular/flex-layout 9.0.0-beta.29 @angular/material 9.2.0 @angular/material-moment-adapter 9.2.0 @ngtools/webpack 9.1.1 @schematics/angular 9.1.1 @schematics/update 0.901.1 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0

Anything else relevant?

Issue Analytics

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

github_iconTop GitHub Comments

9reactions
JoostKcommented, Apr 12, 2020

Hi @ajit007kumar,

Unfortunately I can’t point you to the exact location, but let’s try giving some instructions on how to find the source of the issue.

The issue originates from a binding in an Angular template that contains a colon. Perhaps something like this:

<a [href]="http://example.com"></a>

You can try to locate the source of the error by patching the node_modules\@angular\compiler\bundles\compiler.umd.js as follows:

        Parser.prototype._parseQuote = function (input, location, absoluteOffset) {
            if (input == null)
                return null;
            var prefixSeparatorIndex = input.indexOf(':');
            if (prefixSeparatorIndex == -1)
                return null;
            var prefix = input.substring(0, prefixSeparatorIndex).trim();
            if (!isIdentifier(prefix))
                return null;
            var uninterpretedExpression = input.substring(prefixSeparatorIndex + 1);
            var span = new ParseSpan(0, input.length);
+           this._reportError('quote', input, location);
            return new Quote(span, span.toAbsolute(absoluteOffset), prefix, uninterpretedExpression, location);
        };

This should start report compiler errors including a source location.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 11, 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

Build errors after Upgrading from Angular 8 to 9 - Stack Overflow
Try that: rollback all the changes; remove node_modules folder; npm i / yarn; npm install @angular/cli -g; ng update @angular/cliΒ ...
Read more >
Identify and Fix Build and Deployment Errors in Your Angular ...
In this guide, you will learn how to spot some of the most common build and deployment errors and how to resolve them...
Read more >
ng build - Angular
Option Description Value Type Default Value ‑‑aot Build using Ahead of Time compilation. boolean true ‑‑base‑href Base url for the application being built. string ‑‑delete‑output‑path Delete...
Read more >
How to Optimize your Angular Application for Production
Simply run the following command from your workspace directory. ng build. The ng build command compiles your angular code and places it in...
Read more >
taking build in angular Code Example - Code Grepper
ng build --prod ng build --configuration="test" ng build --configuration="staging"
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