Clarity: Angular cli build error: Error: Internal error: unknown identifier undefined at Object.importExpr$$1

Created on 3 Mar 2018  路  6Comments  路  Source: vmware/clarity

Select one ... (check one with "x")

[X ] bug
[ ] feature request
[ ] enhancement

Expected behavior

Should build with --aot and --prod flags

Actual behavior

When doing an ng build --aot --prod it fails with error "Error: Internal error: unknown identifier undefined at Object.importExpr$$". This is resolved when I rollback to version 0.11.6.

Reproduction of behavior


  • Include a link to the reproduction scenario you created by forking one of the Clarity Plunker Templates:



Environment details

  • Angular version: 4.x.x
    @angular/cdk: 5.2.3
    @angular/cli: 1.7.2
    @angular/language-service: 4.4.6
    @angular/material: 5.2.3
    @angular-devkit/build-optimizer: 0.3.2
    @angular-devkit/core: 0.0.29
    @angular-devkit/schematics: 0.3.2
    @ngtools/json-schema: 1.2.0
    @ngtools/webpack: 1.10.1
    @schematics/angular: 0.3.2
    @schematics/package-update: 0.3.2
    typescript: 2.7.2
    webpack: 3.11.0

  • Clarity version:

    0.11.6

  • OS and version:
    Windows 10 x64

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Chrome

Most helpful comment

Anyone looking for help and if your issue is not about services as injectable, the other case will be your components. Remove default export from your parent components/parent abstract classes. That fixed my issue

All 6 comments

I had the same issue yesterday after doing an npm update. Clarity was updated to 0.11.7 by that. It took me some time to figure out that the Clarity team actually released a patch for this issue, so if you update to 0.11.7-patch.1 this error should be resolved.

@tarquinrex, yes @dorthrithil is correct we had to issue a patch for in improper import that breaks during aot compilation.

Here is the release note: https://vmware.github.io/clarity/news/0.11.7-patch.1

running npm update should get you the latest versions of Clarity.
Please re-open and let me know if you still have compilation issues.

Hi @hippee-lee

I am getting the same error in v0.11.14

Angular CLI: 6.0.2
Node: 8.11.1
OS: darwin x64
Angular: 6.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.2
@angular-devkit/build-angular     0.6.2
@angular-devkit/build-optimizer   0.6.2
@angular-devkit/core              0.6.2
@angular-devkit/schematics        0.6.2
@ngtools/webpack                  6.0.2
@schematics/angular               0.6.1
@schematics/update                0.6.2
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3

Error message

ERROR in : Error: Internal error: unknown identifier undefined
    at Object.importExpr$$1 [as importExpr] (node_modules/@angular/compiler/bundles/compiler.umd.js:20493:23)
    at tokenExpr (node_modules/@angular/compiler/bundles/compiler.umd.js:11721:39)
    at providerDef (node_modules/@angular/compiler/bundles/compiler.umd.js:11647:20)
    at ViewBuilder._visitProviderOrDirective (node_modules/@angular/compiler/bundles/compiler.umd.js:16848:18)
    at ViewBuilder._visitProvider (node_modules/@angular/compiler/bundles/compiler.umd.js:16809:36)
    at node_modules/@angular/compiler/bundles/compiler.umd.js:16672:23
    at Array.forEach (<anonymous>)
    at ViewBuilder._visitElementOrTemplate (node_modules/@angular/compiler/bundles/compiler.umd.js:16657:23)
    at ViewBuilder.visitElement (node_modules/@angular/compiler/bundles/compiler.umd.js:16577:23)
    at ElementAst.visit (node_modules/@angular/compiler/bundles/compiler.umd.js:563:24)
    at visit (node_modules/@angular/compiler/bundles/compiler.umd.js:768:37)
    at node_modules/@angular/compiler/bundles/compiler.umd.js:770:25
    at Array.forEach (<anonymous>)
    at templateVisitAll (node_modules/@angular/compiler/bundles/compiler.umd.js:769:10)
    at ViewBuilder.visitAll (node_modules/@angular/compiler/bundles/compiler.umd.js:16450:9)
    at ViewCompiler.compileComponent (node_modules/@angular/compiler/bundles/compiler.umd.js:16385:17)

Issue is potentially at import {ClrLoadingState, LoadingListener} from "../../utils/loading"; in loading-buttton.ts

Changing import to following, fixes the error

import { LoadingListener } from "../../utils/loading/loading-listener";
import { ClrLoadingState } from "../../utils/loading/loading";

Should I create a new issue, to track the fix
cc: @youdz

Thanks for reporting this @sirajc. The issue you are seeing is similar to this issue. I'll create a new issue to track this one and we will get a fix for it out this week.

Anyone looking for help and if your issue is not about services as injectable, the other case will be your components. Remove default export from your parent components/parent abstract classes. That fixed my issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gnomeontherun picture gnomeontherun  路  27Comments

reddolan picture reddolan  路  121Comments

civanova picture civanova  路  25Comments

spitfjre picture spitfjre  路  33Comments

markofranjic picture markofranjic  路  22Comments