Skip to content

I can't build AOT and the error is giving me nothing? #5294

Closed

Description

@borntodesign

$ ng build -prod --aot

Hash: d230164e916b758d0692
Time: 18475ms
chunk {0} polyfills.c55f89f35c48bf2c6e88.bundle.js (polyfills) 153 kB {5} [initial] [rendered]
chunk {1} scripts.4df4da6c643df8224363.bundle.js (scripts) 750 kB {5} [initial] [rendered]
chunk {2} styles.bd44f3c52773890a1208.bundle.css (styles) 281 bytes {5} [initial] [rendered]
chunk {3} main.daff98269318dace91c3.bundle.js (main) 668 bytes {4} [initial] [rendered]
chunk {4} vendor.094b768043954986be41.bundle.js (vendor) 834 kB [initial] [rendered]
chunk {5} inline.4a76813170987b826954.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in Maximum call stack size exceeded

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '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/Users/baypublishing/projects/vvink/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts

@angular/cli: 1.0.0-rc.1
node: 6.9.2
os: darwin x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

I even created a new project and copied over but no joy?

Activity

  1. RicardoVaranda commented on Mar 8, 2017

    @RicardoVaranda
    Contributor

    Hi @borntodesign ,

    This seemed to have been a problem last month due to users not deleting all of their @angular-cli references. Could you please ensure you run:

    npm uninstall -g @angular-cli
    rm -rf node_modules
    npm install
    

    Within your app folder, also what version of ts are you using?

  2. farin99 commented on Mar 12, 2017

    @farin99

    Hi @RicardoVaranda ,

    I Still see this error which doesn't say much.
    Uninstalled @angular-cli local and global.
    Received the error with both TS 2.2.1 and 2.0.10
    The only thing that seems to makes it work is removing my nested lazy loaded module.

    image

  3. florinbardosi commented on Mar 14, 2017

    @florinbardosi

    Hi all,

    I'm having the same issue

    ERROR in Cannot read property 'text' of undefined

    ERROR in ./src/main.ts
    Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/florinbardosi/Project/src'
    @ ./src/main.ts 4:0-74
    @ multi ./src/main.ts

    @angular/cli: 1.0.0-rc.2
    node: 6.9.5
    os: darwin x64
    @angular/common: 2.4.9
    @angular/compiler: 2.4.9
    @angular/core: 2.4.9
    @angular/forms: 2.4.9
    @angular/http: 2.4.9
    @angular/platform-browser: 2.4.9
    @angular/platform-browser-dynamic: 2.4.9
    @angular/router: 3.4.9
    @angular/cli: 1.0.0-rc.2
    @angular/compiler-cli: 2.4.9
    @angular/language-service: 2.4.8

  4. borntodesign commented on Mar 15, 2017

    @borntodesign
    Author

    @RicardoVaranda I actually have since copied it into a completely fresh angular-cli project and still no joy?

  5. alex88 commented on Mar 16, 2017

    @alex88

    In my case I have just

    Error
        at factoryCallback (/Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/Compilation.js:259:39)
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:234:19
        at onDoneResolving (/Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:59:20)
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:126:20
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:3694:9
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:356:16
        at iteratorCallback (/Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:934:13)
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:840:16
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:3691:13
        at apply (/Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:21:25)
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/node_modules/async/dist/async.js:56:12
        at /Users/alex/Sites/project-api/frontend/node_modules/webpack/lib/NormalModuleFactory.js:121:22
        at onResolved (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:70:11)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at afterInnerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:138:10)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at Resolver.applyPluginsAsyncSeriesBailResult1 (/Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:181:46)
        at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:125:19)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at /Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:283:15
        at /Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:38:4
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at afterInnerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:138:10)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at Resolver.applyPluginsAsyncSeriesBailResult1 (/Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:181:46)
        at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:125:19)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
        at /Users/alex/Sites/project-api/frontend/node_modules/tapable/lib/Tapable.js:283:15
        at innerCallback (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/Resolver.js:123:11)
        at loggingCallbackWrapper (/Users/alex/Sites/project-api/frontend/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    resolve './../$$_gendir/src/app/app.module.ngfactory' in '/Users/alex/Sites/project-api/frontend/src'
      using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./src)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./src)
        using description file: /Users/alex/Sites/project-api/frontend/package.json (relative path: ./$$_gendir/src/app/app.module.ngfactory)
          as directory
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory doesn't exist
          no extension
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory doesn't exist
          .ts
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.ts doesn't exist
          .js
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.js doesn't exist
          .json
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.json doesn't exist
          .css
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.css doesn't exist
          .scss
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.scss doesn't exist
          .html
            Field 'browser' doesn't contain a valid alias configuration
            /Users/alex/Sites/project-api/frontend/$$_gendir/src/app/app.module.ngfactory.html doesn't exist
    

    with no explanation on what the problem is

  6. arlowhite commented on Mar 16, 2017

    @arlowhite

    Just upgraded to @angular/cli: 1.0.0-rc.2
    In a fresh ng new project, ng build -prod builds fine.

    My project builds and runs fine with:

    • ng serve
    • ng build --environment prod --output-hashing=all

    However, these break:

    • ng build -prod
    • ng build --environment prod --output-hashing=all --target=production

    I'm not sure exactly what -prod or --target=production trigger (AOT?) but the build results in this error:

    ERROR in Error encountered resolving symbol values statically. Expression form not supported (position 15:13 in the original .ts file), resolving symbol SearchInputComponent in /home/whitea/Code/boost_dashboard/src/app/shared/search-input/search-input.component.ts

    ERROR in ./src/main.ts
    Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/home/whitea/Code/boost_dashboard/src'
    @ ./src/main.ts 4:0-74
    @ multi ./src/main.ts

    SearchInputComponent is the first declared and exported Component in a shared module.
    main > AppModule > CoreModule > CoreSharedModule > SearchInputComponent
    CoreSharedModule is where I put Components needed by AppComponent in addition to other modules.

  7. alex88 commented on Mar 16, 2017

    @alex88

    Why everyone here has at least an error and I don't have anyhting? :D

  8. alex88 commented on Mar 16, 2017

    @alex88

    In my case I solved by removing --bail option from webpack, so that the error actually shows during build!

  9. florinbardosi commented on Mar 16, 2017

    @florinbardosi

    I had a dummy file from a previous implementation where we used ngrx. After I've removed the file it's working again.

  10. filipesilva commented on Mar 17, 2017

    @filipesilva
    Contributor

    If you can provide a simple repro we can investigate.

  11. jimbarrett33 commented on Mar 24, 2017

    @jimbarrett33

    Today, I was able to build fine with ng build -prod --aot on a new project with the v1.0.0 of the cli.

    However, I do get the error with the latest version of the AotPlugin and on a basic app:

    "@ngtools/webpack": "^1.3.0" - error
    "@ngtools/webpack": "^1.2.8" - no error

    Module not found: Error: Can't resolve '../aot/app/app.module.ngfactory'

    I don't know in which version it started to break.

  12. ycros commented on Mar 25, 2017

    @ycros

    So I think there's probably a few different bugs going on in this issue, but I have a repro for the error that @florinbardosi originally got in a repo at https://github.com/ycros/angular-aot-cryptic-error-repro - in my case it's including a dependency that I guess is incompatible with AOT in some way, and the actual bug is that the error needs to be clearer.

  13. jimbarrett33 commented on Mar 27, 2017

    @jimbarrett33

    Regarding the AotPlugin, in #5329 the fix/workaround by proposed by @tinchou worked for me. It is a window-specific problem.

  14. 7 remaining items

  15. added
    P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful
    and removed
    needs: investigationRequires some digging to determine if action is needed
    on Aug 10, 2017
  16. niikoo commented on Aug 11, 2017

    @niikoo

    +1
    Works with --aot=false

  17. ben-coble-sp commented on Oct 3, 2017

    @ben-coble-sp

    Hey @hansl is there another ticket where this is being more actively investigated or is this on hold? AOT reporting with the ngfactory can be quite difficult to decipher.

  18. removed their assignment
    on Feb 6, 2018
  19. mgechev commented on Dec 18, 2018

    @mgechev
    Member

    Can you reproduce this issue with the latest CLI? If this is still valid, would you provide a minimal demo where we can reproduce the problem?

  20. mgechev commented on Dec 21, 2018

    @mgechev
    Member

    Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)

  21. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  22. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions