Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build aot results in ERROR in Internal error: unknown identifier null #453

Closed
consigliory opened this issue Nov 1, 2017 · 2 comments
Closed
Labels

Comments

@consigliory
Copy link

ERROR in Internal error: unknown identifier null

ERROR in ./Client/main.browser.ts
Module not found: Error: Can't resolve './$$_gendir/app/browser-app.module.ngfactory' in '/Users/roman_petrenko/git/uqualio.githost.io/app/Elixir/Client'
 @ ./Client/main.browser.ts 2:0-89

npm - v
5.5.1
node -v
v8.7.0

@BillSheldon-HunterIndustries
Copy link
Contributor

I just pulled the Angular 5.0 release version. I'm running npm 5.5.1 and node 8.9. The download builds for dev from the command line without error.
From the command line, after the pull I ran "npm install", followed by "npm run build:dev" to verify the build is good.
To test the aot, I use Visual Studio and switched the target to "Release". The application starts up without an issue.

However, when I go back to the command line and execute "npm run build:prod" I get the following output :

webpack --config webpack.config.vendor.js --progress --color "--env.prod"

env = {"prod":true}
[1] Hash: 8d0519d44c09a6bcfcb857903ad55c255c6e4edd
Version: webpack 3.6.0
Child
Hash: 8d0519d44c09a6bcfcb8
Time: 15901ms
Asset Size Chunks Chunk Names
vendor.js 96.8 kB 0 [emitted] vendor
Child
Hash: 57903ad55c255c6e4edd
Time: 16050ms
Asset Size Chunks Chunk Names
vendor.js 1.24 MB 0 [emitted] [big] vendor

angular4-aspnetcore-universal@1.0.0-rc3 build:webpack C:..\aspnetcore-angular2-universal
webpack --progress --color "--env.prod"

[1] Hash: 0bc9d57be3034d209973e37d02dc484572c85471
Version: webpack 3.6.0
Child
Hash: 0bc9d57be3034d209973
Time: 8076ms
Asset Size Chunks Chunk Names
main-client.js 307 kB 0 [emitted] [big] main-client

ERROR in ./ClientApp/boot.browser.ts
Module not found: Error: Can't resolve './../$$_gendir/ClientApp/app/app.module.browser.ngfactory' in 'C:\...\aspnetcore-angular2-universal\ClientApp'
 @ ./ClientApp/boot.browser.ts 3:0-95

ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+
    at throwNotSupportedError (C:\...\aspnetcore-angular2-universal\packages\compiler-cli\src\ngtools_api.ts:132:9)
    at Function.NgTools_InternalApi_NG_2.codeGen (C:\...\aspnetcore-angular2-universal\packages\compiler-cli\src\ngtools_api.ts:80:11)
    at _donePromise.Promise.resolve.then (C:\...\aspnetcore-angular2-universal\node_modules\@ngtools\webpack\src\plugin.js:430:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:678:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

Child
Hash: e37d02dc484572c85471
Time: 10745ms
Asset Size Chunks Chunk Names
main-server.js 1.76 MB 0 [emitted] [big] main-server

ERROR in ./ClientApp/boot.server.ts
Module not found: Error: Can't resolve './../$$_gendir/ClientApp/app/app.module.server.ngfactory' in 'C:\...\aspnetcore-angular2-universal\ClientApp'
 @ ./ClientApp/boot.server.ts 6:0-94

ERROR in Error: Please update @angular/cli. Angular 5+ requires at least Angular CLI 1.5+
    at throwNotSupportedError (C:\...\aspnetcore-angular2-universal\packages\compiler-cli\src\ngtools_api.ts:132:9)
    at Function.NgTools_InternalApi_NG_2.codeGen (C:\...\aspnetcore-angular2-universal\packages\compiler-cli\src\ngtools_api.ts:80:11)
    at _donePromise.Promise.resolve.then (C:\...\aspnetcore-angular2-universal\node_modules\@ngtools\webpack\src\plugin.js:430:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
    at Function.Module.runMain (module.js:678:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular4-aspnetcore-universal@1.0.0-rc3 build:webpack: webpack --progress --color "--env.prod"
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular4-aspnetcore-universal@1.0.0-rc3 build:webpack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users...
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! angular4-aspnetcore-universal@1.0.0-rc3 build:prod: npm run clean && npm run build:vendor -- --env.prod && npm run build:webpack -- --env.prod
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the angular4-aspnetcore-universal@1.0.0-rc3 build:prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users...

@MarkPieszak
Copy link
Member

MarkPieszak commented Nov 3, 2017

Ahh I didn't get to check in the correct NgTools plugin, fixing it now!
It needs to be using const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; in your webpack config.

Fixed via 0ab9dbf

Thank you! @consigliory @BillSheldon-HunterIndustries

BillSheldon-HunterIndustries pushed a commit to BillSheldon-HunterIndustries/aspnetcore-angular2-universal that referenced this issue Jan 17, 2018
BillSheldon-HunterIndustries pushed a commit to BillSheldon-HunterIndustries/aspnetcore-angular2-universal that referenced this issue May 15, 2018
BillSheldon-HunterIndustries pushed a commit to Hunter-Industries/aspnetcore-angular2-universal that referenced this issue May 16, 2018
BillSheldon-HunterIndustries pushed a commit to BillSheldon-HunterIndustries/aspnetcore-angular2-universal that referenced this issue Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants