Error in Could not resolve app module with @ngtools/webpack 1.3.1
See original GitHub issueBug Report or Feature Request (mark with an x)
- bug report -> Similar to issue #4637, now closed, but for latest ngtools
- feature request
Versions.
- Output from:
ng --version. ng is not installed in this project.@ngtools/webpack is. - output from:
node --version: v6.2.2 npm --version: 3.9.5- OS: Windows 10 version 1703, as well as Mac OS Sierra
- angular 4.1.3,
@ngtools/webpack 1.3.1,- webpack 2.5.1,
- typescript 2.3.2.
Repro steps.
There’s a mini sample project showing the issue.
- Clone repository https://github.com/BrainCrumbz/ngtools-webpack-demo and change dir
npm inpm run build-prod
The log given by the failure.
[...redacted...]
[378] ./~/tslib/tslib.es6.js 8.02 kB {1} [built]
[] -> factory:652ms building:2489ms = 3141ms
[379] ./~/zone.js/dist/zone.min.js 29.8 kB {1} [built]
[] -> factory:2333ms building:2441ms dependencies:616ms = 5390ms
+ 369 hidden modules
ERROR in Could not resolve "src/app/module" from "src/app/module".
Child src\shared\view\not-found.component.html:
[0] ./src/shared/view/not-found.component.html 376 bytes {0} [built]
factory:132ms building:31ms = 163ms
Child src\private\view\component.html:
[0] ./src/private/view/component.html 291 bytes {0} [built]
factory:116ms building:38ms = 154ms
[...redacted...]
Desired functionality.
Build should complete successfully.
Mention any other details that might be useful.
The app has a lazily loaded module (dubbed private). You can build it in development as well (npm run build-dev), serve it from another shell (npm run serve) and browse to localhost:3000. The readme in repository root shows all npm commands.
The AOT build is not using full angular-cli, just @ngtools/webpack.
I tried fiddling with angularCompilerOptions.genDir value in AOT tsconfig, with no luck. That just changed the error message, for example it changed the path as Could not resolve “./src/app/module” from “./src/app/module”., but no real clue about it.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (3 by maintainers)
Top Results From Across the Web
I am trying to npm install ngtools/webpack@1.3.3 Module ...
It is a bug in angular universal using ng-seed i have install package "enhanced-resolve": "3.3.0" in package.json. its working fine for me.
Read more >New Section - Angular Components and Core Directives
I'm getting the following. ERROR in ./src/polyfills.ts. Module not found: Error: Can't resolve '@angular/localize/init'.
Read more >Emit attempted before Angular Webpack plugin ...
This appears to be an issue with Typescript version >4.9.0. I haven't worked out what that is yet, but a possible workaround is...
Read more >angular/angular-cli - Gitter
I am using ngtools/webpack, but I can't get the AoT bundle to work. It seems to complete the bundling but my bundle only...
Read more >Angular
Thanks in advance. ./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mradcliffe that error has been fixed by 1.0.6. This is a different error.
@GiuseppePiscopo we’re going to investigate.
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.