angular-seed-advanced: NativeScript AoT build fails

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 => Please do not submit support request here, instead see use [gitter](https://gitter.im/mgechev/angular2-seed) or [stackoverflow](https://stackoverflow.com/questions/tagged/angular2)

Current behavior:

When I tried to run iOS build from clear seed, first I got the same error as described in second post of issue #369:

Running webpack for ios… /Users/jcarneiro/Downloads/angular-seed-advanced-master/nativescript/webpack.common.js:73 new nsWebpack.ExcludeUnusedElementsPlugin(), ^

TypeError: nsWebpack.ExcludeUnusedElementsPlugin is not a constructor

Then after commenting ExcludeUnusedElementsPlugin out (as suggested in #372) the build failed on:

ERROR in Error encountered resolving symbol values statically. Calling function ‘ɵmakeDecorator’, function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/node_modules/nativescript-angular/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/node_modules/nativescript-angular/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/node_modules/nativescript-angular/node_modules/@angular/core/core.d.ts

ERROR in ./app.aot.ts Module not found: Error: Can’t resolve ‘./native.module.ngfactory’ in ‘/Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/app’ @ ./app.aot.ts 3:0-66 child process exited with code 2

npm ERR! Darwin 16.5.0 npm ERR! argv “/usr/local/Cellar/node/7.7.4/bin/node” “/usr/local/bin/npm” “run” “ns-bundle” “–ios” “–start-app” npm ERR! node v7.7.4 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE npm ERR! angular-seed-advanced@0.0.0 ns-bundle: ns-bundle npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular-seed-advanced@0.0.0 ns-bundle script ‘ns-bundle’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-seed-advanced package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ns-bundle npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-seed-advanced npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls angular-seed-advanced npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/npm-debug.log

npm ERR! Darwin 16.5.0 npm ERR! argv “/usr/local/Cellar/node/7.7.4/bin/node” “/usr/local/bin/npm” “run” “start-ios-bundle” npm ERR! node v7.7.4 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE npm ERR! angular-seed-advanced@0.0.0 start-ios-bundle: npm run ns-bundle --ios --start-app npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-seed-advanced@0.0.0 start-ios-bundle script ‘npm run ns-bundle --ios --start-app’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-seed-advanced package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! npm run ns-bundle --ios --start-app npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-seed-advanced npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls angular-seed-advanced npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/danielkucal/Applications/Angular2/angular-seed-advanced/nativescript/npm-debug.log

npm ERR! Darwin 16.5.0 npm ERR! argv “/usr/local/Cellar/node/7.7.4/bin/node” “/usr/local/bin/npm” “run” “build.ios” npm ERR! node v7.7.4 npm ERR! npm v4.1.2 npm ERR! code ELIFECYCLE npm ERR! angular-seed-advanced@0.0.0 build.ios: gulp build.prod.tns && cd nativescript && npm run start-ios-bundle npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-seed-advanced@0.0.0 build.ios script ‘gulp build.prod.tns && cd nativescript && npm run start-ios-bundle’. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular-seed-advanced package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! gulp build.prod.tns && cd nativescript && npm run start-ios-bundle npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular-seed-advanced npm ERR! Or if that isn’t available, you can get their info via: npm ERR! npm owner ls angular-seed-advanced npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/danielkucal/Applications/Angular2/angular-seed-advanced/npm-debug.log What is worth to note, file nativescript/app/native.module.ngfactory wasn’t created at all.

Expected behavior:

I think the build should pass. Running npm run start.ios works. tns build ios also seems to work.

Minimal reproduction of the problem with instructions

  1. Clone the repo
  2. npm install
  3. npm run build.ios

What is the motivation / use case for changing the behavior?

I don’t know, just think the world would be better if it work.

Please tell us about your environment:

MacOS Sierra 10.12.4 npm@4.1.2 node@7.7.4 tns@2.5.4

  • Angular Seed Version: 8c892c4 (newest for today)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 29 (10 by maintainers)

Commits related to this issue

Most upvoted comments

With a fresh pull off of both Master and the PR branch (https://github.com/NathanWalker/angular-seed-advanced/pull/442) I’m still getting the same error on builds (npm run build.ios): ERROR in ./app.aot.ts Module not found: Error: Can’t resolve ‘./native.module.ngfactory’ in ‘/Users/CIll/Documents/angular-seed-advanced/nativescript/app’ @ ./app.aot.ts 4:32-68 Child app/app/components/app.component.html: + 1 hidden modules Child app/app/modules/i18n/components/lang-switcher.component.html: + 1 hidden modules Child app/app/components/about/about.component.html: + 1 hidden modules Child app/app/components/home/home.component.html: + 1 hidden modules Child app/app/modules/shared/components/navbar/navbar.component.html: + 1 hidden modules Child app/app/modules/shared/components/toolbar/toolbar.component.html: + 1 hidden modules Child app/app/modules/i18n/components/lang-switcher.component.ios.css: + 1 hidden modules Child app/app/components/about/about.component.css: + 1 hidden modules Child app/app/components/home/home.component.css: + 1 hidden modules Child app/app/modules/shared/components/navbar/navbar.component.css: + 1 hidden modules Child app/app/modules/shared/components/toolbar/toolbar.component.css: + 1 hidden modules Child extract-text-webpack-plugin: [0] …/~/nativescript-css-loader/lib/css-base.js 1.51 kB {0} [built] [1] …/~/resolve-url-loader?{“silent”:true,“absolute”:false,“sourceMap”:false,“fail”:false,“keepQuery”:false,“debug”:false,“root”:null}!../~/nativescript-css-loader!../~/nativescript-dev-webpack/platform-css-loader.js!./app.ios.css 13.4 kB {0} [built] child process exited with code 2

in PR for this fix (https://github.com/NathanWalker/angular-seed-advanced/pull/442) @m-abs said:

So the scss-files weren’t compiled.

This looks like the same thing I’m experiencing, wondering if I’m experiencing something specific to my environment since it sounds like this issues was resolved. I’ve tried deleting all packages and reinstalling and like I mentioned before I’ve done several fresh pulls/installs.

My environ: OSx 10.12.6 node v6.10.2 npm v3.10.10 webpack 2.6.1 tns 3.0.3 typescript 2.3.4

I am able to do a JIT build by pointing to NativeModule instead of NativeModuleNgFactory in AOT but as expected the app takes about 15 - 20 seconds to start.

Any insights/help would be greatly appreciated.

I am facing the same issue when I run the following command:

npm run build.android

ERROR in ./app.aot.ts Module not found: Error: Can't resolve './native.module.ngfactory' in 'D:\Projects\seedproject\nativescript\app' @ ./app.aot.ts 4:32-68

My environment details: Operating System: Windows 10 node: 6.11.1 npm: 3.10.10 tsc: 2.3.4 tns: 3.1.2 webpack: 3.4.1

Please help. I am evaluating NativeScript and it’s very important for me to make sure that its works for my project.

@Dutchboy this will be solved in this PR: https://github.com/NathanWalker/angular-seed-advanced/pull/419 Hope to be able to finish it by end of upcoming weekend.

@NathanWalker Been 20 days since you said anything about the branch, though you didn’t say it’s name, i guess is this one: https://github.com/NathanWalker/angular-seed-advanced/tree/nativescript-3-angular-4-1-typescript-2-2

Since it has been merged and i still have issues, does it mean AoT support is still far away?

image

Hi all… I’ve found some discrepancies in the versions used in ./nativescript/package.json compared to what they’ve recommended here

Now my local repo shows no errors. One might say that the problem is solved, but the output apk (android) still starts up in 13 seconds, not the 2 seconds AOT promises… So, my guess is, it still produces JIT…

I’m new to WebPack though… I have sticked for too long with systemJS and JSPM, which, as a project, is stale…

+1.

Having the same issue here on a clean copy of the seed. build.ios fails with error:

ERROR in ./app.aot.ts
Module not found: Error: Can't resolve './native.module.ngfactory' in '/Users/jcarneiro/Downloads/angular-seed-advanced-master/nativescript/app'
 @ ./app.aot.ts 3:0-66

Looking at nativescript/app, I see no ngfactory.js files there. Might be related to various tools versions.

Here is my environment: node: 7.4.0 npm: 4.0.5 tsc: 2.2.2 tns: 2.5.2 webpack: 2.3.2