Skip to content

Error in Could not resolve app module with @ngtools/webpack 1.3.1 #6462

@GiuseppePiscopo

Description

@GiuseppePiscopo

Bug Report or Feature Request (mark with an x)

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.

  1. Clone repository https://github.com/BrainCrumbz/ngtools-webpack-demo and change dir
  2. npm i
  3. npm 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions