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.

Webpack AOT build fails

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request/question

Current behavior

AOT build fails in prod. In local with just regular webpack it runs fine. Include “import {TagInputModule} from ‘ng2-tag-input’;” in module and AOT fails with a not very informative 17% building modules 61/62 modules 1 active ...rise\front\static\scss\bootstrap.scssModuleNotFoundError: Module not found: Error: Can't resolve './../aot/app/app.module.ngfactory' Without the TagInputModule import it builds fine.

17% building modules 61/62 modules 1 active …rise\front\static\scss\bootstrap.scssModuleNotFoundError: Module not found: Error: Can’t resolve ‘./…/aot/app/app.module.ngfactory’ in ‘C:\Users\Harles\Documents\Projects\vitarise\front\app’ at factoryCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\webpack\lib\Compilation.js:260:39) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\webpack\lib\NormalModuleFactory.js:243:19 at onDoneResolving (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\webpack\lib\NormalModuleFactory.js:59:20) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\webpack\lib\NormalModuleFactory.js:132:20 at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:3694:9 at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:356:16 at iteratorCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:934:13) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:840:16 at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:3691:13 at apply (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:21:25) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\async\dist\async.js:56:12 at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\webpack\lib\NormalModuleFactory.js:124:22 at onResolved (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:70:11) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at afterInnerCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:138:10) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\tapable\lib\Tapable.js:181:46) at innerCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:125:19) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\tapable\lib\Tapable.js:283:15 at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:38:4 at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at afterInnerCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:138:10) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\tapable\lib\Tapable.js:181:46) at innerCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:125:19) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\tapable\lib\Tapable.js:283:15 at innerCallback (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\Resolver.js:123:11) at loggingCallbackWrapper (C:\Users\Harles\Documents\Projects\vitarise\front\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) resolve ‘./…/aot/app/app.module.ngfactory’ in ‘C:\Users\Harles\Documents\Projects\vitarise\front\app’ using description file: C:\Users\Harles\Documents\Projects\vitarise\front\package.json (relative path: ./app) Field ‘browser’ doesn’t contain a valid alias configuration after using description file: C:\Users\Harles\Documents\Projects\vitarise\front\package.json (relative path: ./app) using description file: C:\Users\Harles\Documents\Projects\vitarise\front\package.json (relative path: ./aot/app/app.module.ngfactory) as directory C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory doesn’t exist no extension Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory doesn’t exist .ts Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory.ts doesn’t exist .js Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory.js doesn’t exist .html Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory.html doesn’t exist .css Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory.css doesn’t exist .scss Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\Harles\Documents\Projects\vitarise\front\aot\app\app.module.ngfactory.scss doesn’t exist

Expected behavior

AOT build runs without errors

Minimal reproduction of the problem with instructions (if applicable)

What is the motivation / use case for changing the behavior? (if applicable)

What do you use to build your app? (SystemJS, Webpack, angular-cli, etc.). Please specify the version

Webpack and Webpack AOT

Angular version:

Angular 4.2.2
Webpack 2.3.3
@ngtools/webpack 1.4.1

ng2-tag-input version:

ng-tag-input 1.3.3

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 ]

all

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
kadosh1000commented, Aug 23, 2017

I am facing the same issue. It works great without AOT. when I compile it using AOT it seems that the css is not loading correctly or at all : image

@dbusacca I have tried adding the loaders you’ve specified but the result hasn’t changed.

@Gbuomprisco Any news regarding this issue?

1reaction
Gbuompriscocommented, Aug 23, 2017

It’s not something I’ve been able to reproduce

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack AoT build fails · Issue #1730 · ng-bootstrap ... - GitHub
Bug description: Webpack AoT build fails when ng-bootstrap is in the mix. Several errors like the following appear: ERROR in .
Read more >
Angular 8 webpack AOT build failed - Cannot ... - Stack Overflow
In my case, it was ERROR in Cannot read property 'name' of undefined while I was trying to run npm run build in...
Read more >
Webpack AOT build errors - Material Design for Bootstrap
Topic: Webpack AOT build errors ... A question was posed earlier by someone stating that your project throws errors in Jhipster (or any...
Read more >
Angular 8 Webpack Aot Build Failed - Cannot Read ... - ADocLib
Hi, i just tried to migrate to Angular 9 and followed the Instruction. But getting this mistake:ERROR in Cannot read property 'length' of...
Read more >
Ahead-of-time (AOT) compilation - Angular
The AOT compiler detects and reports template binding errors during the build step before users can see them. Better security, AOT compiles HTML...
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