angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

AOT compilation failure in reading the entry module

Open wesleycho opened this issue 9 years ago • 9 comments

OS?

macOS 10.12.1

Versions.

Node 4.5 - no CLI usage

Repro steps.

My app was unchanged - I upgraded from Angular 2.2.4 to 2.4.0, and @ngtools/webpack from 1.1.9 to 1.2.1

The log given by the failure.

The only error message is

ERROR in Could not resolve "src/app/app.aot.module.ts" from "src/app/app.aot.module.ts".

No stack trace present, and everything else seems to compile fine.

Mention any other details that might be useful.

Cross-linking https://github.com/angular/angular/issues/13613 with more details

wesleycho avatar Dec 21 '16 15:12 wesleycho

was running into a similar issue, if you have cli beta 24 try using the angular version 2.3.1 if you look at the cli package.json they're using below. "@angular/common": "^2.3.1", "@angular/compiler": "^2.3.1", "@angular/core": "^2.3.1", "@angular/forms": "^2.3.1", "@angular/http": "^2.3.1", "@angular/platform-browser": "^2.3.1", "@angular/platform-browser-dynamic": "^2.3.1", "@angular/router": "^3.3.1", "core-js": "^2.4.1", "rxjs": "^5.0.1", "ts-helpers": "^1.1.1", "zone.js": "^0.7.2"

i tried running with 2.4.0 and it failed saw many people having the same issue, and downgraded angular to 2.3.1 now it works no problem.

gregatcssi avatar Dec 21 '16 19:12 gregatcssi

I am not using the CLI. I do use Webpack, and am using @ngtools/webpack.

This appears to be a @ngtools/webpack bug, as using raw ngc works flawlessly (when all webpack specific things are removed - in my case, we use scss so I had to remove it from every component in order to verify that ngc works).

wesleycho avatar Dec 21 '16 19:12 wesleycho

Same here. ERROR in Could not resolve module ./index.ts relative to /application/index.ts

Raw ngc ist working also flawlessly, but with @ngtools/webpack i'm getting the error above.

Deps: "@angular/common": "2.4.1", "@angular/compiler": "2.4.1", "@angular/compiler-cli": "2.4.1", "@angular/core": "2.4.1", "@angular/forms": "2.4.1", "@angular/http": "2.4.1", "@angular/platform-browser": "2.4.1", "@angular/platform-browser-dynamic": "2.4.1", "@angular/platform-server": "2.4.1", "@angular/router": "3.4.1", "@ngtools/webpack": "^1.2.0"

cyr-x avatar Dec 22 '16 17:12 cyr-x

Any progress or workaround on this issue?

linusfoldemo avatar Jan 11 '17 09:01 linusfoldemo

Found a workaround, use full path to entryModule in webpack.config.js.

plugins: [
    new AotPlugin({
      tsConfigPath: 'path/to/tsconfig.json',
      entryModule: __dirname + '/app.module#AppModule'
    })
  ]

linusfoldemo avatar Jan 11 '17 12:01 linusfoldemo

I confirm that @linusfoldemo 's workaround works for me too. Thanks!

danieleds avatar Jan 11 '17 13:01 danieleds

I have the same problem, it used to work with a relative path in entryModule. @linusfoldemo ' s workaround works for me.

  • Windows7x64
  • node 6.9.3
  • npm 4.1.1.
  • webpack 2.2.0
  • @ngtools/webpack 1.2.4
  • @angular/.. 2.3.1

mariussl avatar Jan 25 '17 15:01 mariussl

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

filipesilva avatar May 22 '17 15:05 filipesilva

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.