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.

Angular CLI 1.2.6 Build AOT Fail

See original GitHub issue

Hi,

I create a pacakge with your generator and publish it to an local artifactory. I can import it, use it in dev mode, but I try to do ng build --prod to build in aot mode I have some error prompt. It say that Cannot Find oel-gabarits on some component of my application and error inside the nodes_modules…

Here’s a copy paste of the log in my console

ng build --prod Hash: 16a5b46d4ed9799a9444 Time: 15042ms chunk {0} polyfills.86c0b4d44f70fee7f41e.bundle.js (polyfills) 255 kB {4} [initial] [rendered] chunk {1} main.3c31870d629bceebe9f8.bundle.js (main) 256 kB {3} [initial] [rendered] chunk {2} styles.acbe024ab0f7dafcc3aa.bundle.css (styles) 69 bytes {4} [initial] [rendered] chunk {3} vendor.52c64a0afab9cdf1414c.bundle.js (vendor) 1.31 MB [initial] [rendered] chunk {4} inline.46e0b4bbe8a4c486211c.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/app/solution-investissement/solution-investissement.component.ngfactory.ts (12,21): Cannot find module 'oel-gabarits'.

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/node_modules/oel-gabarits-temp/oel-gabarits.ngfactory.ts (10,21): Cannot find module 'oel-gabarits'.

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/app/app.module.ngfactory.ts (26,22): Cannot find module 'oel-gabarits'.

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/app/app.module.ngfactory.ts (26,22): Cannot find module 'oel-gabarits'.

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/app/solution-investissement/solution-investissement.component.ngfactory.ts (12,21): Cannot find module 'oel-gabarits'.

ERROR in C:/Desjardins/dev/FondsDesjardins/fonds-desjardins-extranet/formulaires/choix-investissement-helios2/src/$$_gendir/node_modules/oel-gabarits-temp/oel-gabarits.ngfactory.ts (10,21): Cannot find module 'oel-gabarits'.

ERROR in ./src/$$_gendir/app/app.module.ngfactory.ts Module not found: Error: Can't resolve 'oel-gabarits' in 'C:\Desjardins\dev\FondsDesjardins\fonds-desjardins-extranet\formulaires\choix-investissement-helios2\src\$$_gendir\app' @ ./src/$$_gendir/app/app.module.ngfactory.ts 24:0-36 @ ./src/main.ts @ multi ./src/main.ts

ERROR in ./src/$$_gendir/app/solution-investissement/solution-investissement.component.ngfactory.ts Module not found: Error: Can't resolve 'oel-gabarits' in 'C:\Desjardins\dev\FondsDesjardins\fonds-desjardins-extranet\formulaires\choix-investissement-helios2\src\$$_gendir\app\solution-investissement' @ ./src/$$_gendir/app/solution-investissement/solution-investissement.component.ngfactory.ts 10:0-35 @ ./src/$$_gendir/app/app.module.ngfactory.ts @ ./src/main.ts @ multi ./src/main.ts

ERROR in ./src/$$_gendir/~/oel-gabarits-temp/oel-gabarits.ngfactory.ts Module not found: Error: Can't resolve 'oel-gabarits' in 'C:\Desjardins\dev\FondsDesjardins\fonds-desjardins-extranet\formulaires\choix-investissement-helios2\src\$$_gendir\node_modules\oel-gabarits-temp' @ ./src/$$_gendir/~/oel-gabarits-temp/oel-gabarits.ngfactory.ts 8:0-35 @ ./src/$$_gendir/app/solution-investissement/solution-investissement.component.ngfactory.ts @ ./src/$$_gendir/app/app.module.ngfactory.ts @ ./src/main.ts @ multi ./src/main.ts

Does someone have this issue and how to fix it ?

Thank you !

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:12

github_iconTop GitHub Comments

2reactions
chriszrccommented, Sep 10, 2017

Hi, Right so I would guess that maybe this library started out as “oel-gabarits” and then somewhere along the line, maybe you updated to “oel-gabarits-temp”. To the best of my knowledge, you are only seeing that error when running the prod build because that’s when the cli is trying to do all of its fancy compilation, and looks at things like the flatmoduleid. The error indicates that it can’t find a npm module with that name. I would probably do a search in your app for any references to “oel-gabarits” without the temp-

1reaction
devshangaricommented, Sep 27, 2017

I seem to be having the same issue, but i am using a scoped package name, as i publish the package privately on npm. Do you think that could be why it isnt working for me? When i do a regular build (ng build / ng serve) it works fine, but when i try and do a production build (ng build --prod / ng serve --prod) it fails with the module not found error.

Update: adding the scope name to the flatmoduleid worked for me. Should have read the documentation better 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular CLI 1.2.6 Stopping at 14% on ng build -prod
I have tried starting a new project and using the same set of package.json dependencies and seeing if I can run it with...
Read more >
Angular CLI ng build fails - Visual Studio Feedback
0 application to compile and I just cant. My setup is: An NPM task with custom command to install the angular cli, command:...
Read more >
angular/angular-cli - Gitter
Hey everyone. I just started experiencing a very weird issue when trying to build my angular app. I get the error "An unhandled...
Read more >
Angular CLI builders
A number of Angular CLI commands run a complex process on your code, such as linting, building, or testing. The commands use an...
Read more >
@angular/cli | Yarn - Package Manager
@angular-devkit/build-angular. Commit, Type, Description. ccc8e0350, fix, display actionable error when a style does not exist in Karma builder.
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