AOT Error: Internal error: unknown identifier undefined


#1

I have an error that I cannot for the life of me figure out:

Error: Internal error: unknown identifier undefined
    at Object.importExpr$$1 [as importExpr] (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:31063:23)
    at tokenExpr (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:20063:39)
    at providerDef (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:19966:20)
    at /Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:20188:77
    at Array.map (<anonymous>)
    at NgModuleCompiler.compile (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:20188:44)
    at AotCompiler._compileModule (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:30956:32)
    at /Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:30838:66
    at Array.forEach (<anonymous>)
    at AotCompiler._compileImplFile (/Users/ehorodys/Projects/Ionic2/flagship/node_modules/@angular/compiler/bundles/compiler.umd.js:30838:19)

Is there a way using Ionic 3 that I can:

  1. Build in --prod mode with AOT turned off (worse case scenario)
  2. Get more context into this error? I think it’s from a home-grown Angular library we built, but it compiles fine in it’s test app we use while we build the library.

Thanks for the help


#2

Found the issue, I was trying to use barrel files to import services/components in the library’s .module.ts files. That’s a big no-no!

We can remove this thread if you’d like, or keep around for reference. I hope this helps someone in the future!