Closed DanielKucal closed 7 years ago
+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
groceries app solved the same issue here upgrading webpack, but I guess this uses systemjs. https://github.com/NativeScript/sample-Groceries/issues/224 Let me know with steps if anyone have solved it
Checkout an old commit and it works just fine
commit e72243397ff9955fe307178d71be2215339cf2f6 Author: Yavin 5 yavinfive464@gmail.com Date: Mon Mar 27 00:51:30 2017 +0200
@ishandutta2007 I did try to checkout that commit but it still fails to build.ios
.
Also, that commit is still on Angular 2, while latest seed uses Angular 4.
Big difference there..
The issue you mentioned on sample-Groceries
is not the problem indicated here in this issue. That problem was covered here: https://github.com/NathanWalker/angular-seed-advanced/issues/372.
I believe the problem might be nativescript-webpack
related, which for some reason does not run compile-cli to generated the missing native.module.ngfactory.js
file.
I've pushed up some updates and improvements here, getting closer. Still seeing this:
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/nathan/Documents/github/NathanWalker/angular-seed-advanced/nativescript/node_modules/nativescript-angular/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/nathan/Documents/github/NathanWalker/angular-seed-advanced/nativescript/node_modules/nativescript-angular/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/nathan/Documents/github/NathanWalker/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/nathan/Documents/github/NathanWalker/angular-seed-advanced/nativescript/app'
@ ./app.aot.ts 4:32-68
@m-abs if you get a chance, do you have any insight here on latest master?
Note that there's this open issue which seems related: https://github.com/angular/angular/issues/15767 "AOT on case insensitive file systems fails"
Also would like to mention getting the same issue when building android aot on windows, thank you.
@NathanWalker I'm getting a lot of errors. One of them is related to a conflict between nativescript-angular's dependencies and the seeds dependencies. nativescript-angular wants ng=4.0.0 and the seed wants ^4.0.0. So I've got two versions of ng-4.0 installed. But fixing that gives me some other errors.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/node_modules/nativescript-angular/router.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/frame/frame.d.ts' is not a module.
/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/nativescript-angular/router.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/app/app/components/app.component.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
/home/mabs/project/angular2-seed-advanced/nativescript/app/app/components/app.component.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/frame/frame.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/app/app/components/about/about.component.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/node_modules/nativescript-angular/nativescript.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/frame/frame.d.ts' is not a module.
/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/nativescript-angular/nativescript.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/app/components.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/frame/frame.d.ts' is not a module.
/home/mabs/project/angular2-seed-advanced/nativescript/app/components.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/app/native.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/frame/frame.d.ts' is not a module.
/home/mabs/project/angular2-seed-advanced/nativescript/app/native.module.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
ERROR in /home/mabs/project/angular2-seed-advanced/nativescript/node_modules/nativescript-angular/directives/action-bar.ngfactory.ts (1,1): File '/home/mabs/project/angular2-seed-advanced/nativescript/node_modules/tns-core-modules/ui/page/page.d.ts' is not a module.
Unfortunately I don't have time to dig more into it right now. There is a newer version of nativescript-dev-webpack than the one the seed depends on, but again no time right now.
Thanks @m-abs n/p! I'll try that latest version and see where that goes.
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...
Hmmmm..... I've tried a PR for the very first time, but the Github Windows Client greyed it out....
Hai @NathanWalker. I am experiencing this on windows build too.
@Dutchboy I tried to use those recommended versions and I still get the missing native.module.ngfactory
error.
I does clear the other error related to 'ɵmakeDecorator'
and other stuff.
But still unable to build prod.
@NathanWalker Any new insights / thoughts / solution on this issue?
@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.
I see that PR: #419 is merged, but at a clean build for android the problem still exists for me.
Adding platform android@3.0.0...
Running webpack for android...
94% asset optimization[copy-webpack-plugin] WARNING - unable to locate 'app.css' at 'C:\Users\User\Documents\projects\angular2-seed_original\nativescript\app\app.css' Hash: b035f0573a91a218cc20
Version: webpack 2.5.1
Time: 5000ms
Asset Size Chunks Chunk Names
bundle.js 963 bytes 0 [emitted] bundle
vendor.js 2.96 MB 1 [emitted] [big] vendor
package.json 514 bytes [emitted]
starter.js 41 bytes [emitted]
tns-java-classes.js 0 bytes [emitted]
[1] ../~/@angular/core/@angular/core.es5.js 467 kB {1} [built]
[14] ../~/@angular/forms/@angular/forms.es5.js 203 kB {1} [built]
[16] ../~/@angular/common/@angular/common.es5.js 130 kB {1} [built]
[17] ../~/@angular/router/@angular/router.es5.js 210 kB {1} [built]
[30] ../~/@angular/http/@angular/http.es5.js 74.7 kB {1} [built]
[31] ../~/@angular/platform-browser/@angular/platform-browser.es5.js 142 kB {1} [built]
[41] ../~/reflect-metadata/Reflect.js 48 kB {1} [built]
[42] ../~/nativescript-angular/platform-static.js 849 bytes {1} [built]
[89] ../~/rxjs/BehaviorSubject.js 1.67 kB {1} [built]
[159] ../~/nativescript-angular/forms.js 1.52 kB {1} [built]
[160] ../~/nativescript-angular/http.js 1.42 kB {1} [built]
[161] ../~/nativescript-angular/router.js 3.18 kB {1} [built]
[162] ./vendor-platform.android.ts 1.07 kB {1} [built]
[173] ./app.aot.ts 533 bytes {0} [built]
[174] ./vendor.ts 444 bytes {1} [built]
+ 238 hidden modules
ERROR in Entry module not found: Error: Can't resolve './app.css' in 'C:\Users\User\Documents\projects\angular2-seed_original\nativescript\app'
ERROR in ENOENT: no such file or directory, open 'C:\Users\User\Documents\projects\angular2-seed_original\nativescript\app\app\modules\i18n\components\lang-switcher.component.android.css'
ERROR in ./app.aot.ts
Module not found: Error: Can't resolve './native.module.ngfactory' in 'C:\Users\User\Documents\projects\angular2-seed_original\nativescript\app'
@ ./app.aot.ts 4:32-68
ERROR in [copy-webpack-plugin] unable to locate 'app.css' at 'C:\Users\User\Documents\projects\angular2-seed_original\nativescript\app\app.css'
@NathanWalker @dbeulen I just did a clean
git clone
npm i
// removed / renamed the nativescript/src/app.ts (to make sure it really does aot)
npm run start.android
and it works again... THNX!!!
There are still some issues with AoT and webpack here unfortunately - I've been working on a branch to resolve them and am quite close. @Dutchboy AoT via webpack only occurs with this command:
npm run build.ios
// or...
npm run build.android
Which queue into the webpack/AoT build of the {N} app.
@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?
@luchillo17 I've got a WIP branch in a pull request with it working here, it's been working fine for our team but there are probably some edge cases that aren't addressed. I know @m-abs also has a WIP branch (there is a link to it in that MR).
Thank you @llwt and @m-abs your contributions are greatly appreciated under these circumstances. My free time has been severely limited. I'm monitoring the PR and I'm going to add you both as trusted contributors with push writes. Perhaps the 2 branches of work can be reconciled to resolve all the AoT issues?
Seeing that time is not allowing this to be solved for anytime soon, does anyone know if there is a workaround that will allow for a npm run build.ios to complete without AOT (iow generate a compiled .ipa)?
@404Assassin this PR: https://github.com/NathanWalker/angular-seed-advanced/pull/442 was merged last night - please try merging in latest master with that and see if it helps you?
Confirmed fix on master 👍
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.
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:
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.
When I merged the lastest changes from master the error persist. I updated @ngtools/webpack
to 1.7.4 and the AOT just worked.
I'm getting the app.css not found as well while running npm run start-android-bundle
(with the latest versions of packages). I'm using platform-specific css files (ios and android), and the app.css is simply not being generated. If I manually add the app.css file (like in the groceries app) then the build works.
Any idea if that is the only workaround for now (adding the app.css file manually)?
Thanks! Vladimir
ERROR in Entry module not found: Error: Can't resolve './app.css' in '/my-app'
ERROR in [copy-webpack-plugin] unable to locate 'app.css' at '/my-app/app.css'
"devDependencies": {
"@angular/compiler-cli": "4.4.6",
"@ngtools/webpack": "1.7.4",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"codelyzer": "3.2.2",
"copy-webpack-plugin": "4.2.0",
"extract-text-webpack-plugin": "~3.0.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.1",
"nativescript-dev-sass": "1.3.2",
"nativescript-dev-typescript": "0.5.1",
"nativescript-dev-webpack": "^0.8.0",
"nativescript-worker-loader": "~0.8.1",
"node-sass": "4.6.0",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.2.0",
"tslint": "5.8.0",
"typescript": "2.6.1",
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-sources": "~1.0.2"
}
@exeleon Thanks! AOT build worked for me with this change (@ngtools/webpack to 1.7.4) on a fresh pull. I tested before making the change with the repo's current version("@ngtools/webpack": "1.3.1") first and AOT build failed but after updating to 1.7.4 the build completed! BUILD SUCCEEDED
I'm curious as to what's different with our environments that requires this change, how did you discover this solution?
Guys, I have been facing this issue since the past couple of days and I am unable to successfully figure out the solution. Any help will be highly appreciated. I cannot do a new clone since I've an existing project and I've to make it work.
I am directly running from the nativescript folder using tns run android --bundle
command.
Here's what my package.json
( from the nativescript folder ) looks like.
[{
"name": "angular-seed-advanced",
"version": "0.0.0",
"nativescript": {
"id": "com.maxtoolbox.vrsta",
"tns-android": {
"version": "3.3.0"
},
"tns-ios": {
"version": "3.3.0"
}
},
"scripts": {
"preinstall": "mkdirp app",
"clean": "rimraf platforms node_modules lib hooks app && mkdirp app",
"ns-bundle": "ns-bundle",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
},
"dependencies": {
"@angular/animations": "~4.1.2",
"@angular/common": "~4.1.2",
"@angular/compiler": "~4.1.2",
"@angular/core": "~4.1.2",
"@angular/forms": "~4.1.2",
"@angular/http": "~4.1.2",
"@angular/platform-browser": "~4.1.2",
"@angular/router": "~4.1.2",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^2.0.3",
"@ngrx/store": "^2.2.2",
"@ngx-translate/core": "~7.0.0",
"@ngx-translate/http-loader": "~0.1.0",
"angulartics2": "^2.2.2",
"lodash": "^4.17.4",
"nativescript-angular": "~3.1.1",
"nativescript-background-http": "^3.1.0",
"nativescript-camera": "^3.1.4",
"nativescript-checkbox": "^3.0.1",
"nativescript-fingerprint-auth": "^5.0.0",
"nativescript-imagepicker": "^4.0.1",
"nativescript-iqkeyboardmanager": "^1.1.0",
"nativescript-localstorage": "^1.1.2",
"nativescript-mediafilepicker": "^1.0.4",
"nativescript-pdf-view": "^2.0.1",
"nativescript-plugin-firebase": "^4.2.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-purchase": "^1.0.5",
"nativescript-theme-core": "^1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-videoplayer": "^3.1.0",
"ngrx-store-freeze": "0.1.9",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.4.0",
"tns-core-modules": "^3.3.0",
"zone.js": "^0.8.10"
},
"devDependencies": {
"@angular/compiler-cli": "~4.1.2",
"@ngrx/store-devtools": "~3.2.4",
"@ngtools/webpack": "1.3.1",
"@types/jasmine": "2.5.41",
"@types/lodash": "4.14.63",
"babel-traverse": "6.11.4",
"babel-types": "6.11.1",
"babylon": "6.8.4",
"codelyzer": "^3.0.1",
"copy-webpack-plugin": "~4.0.1",
"extract-text-webpack-plugin": "~2.1.0",
"fs-extra": "^0.30.0",
"glob": "^7.0.5",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-android-snapshot": "^0.0.9",
"nativescript-dev-sass": "^1.1.1",
"nativescript-dev-webpack": "^0.6.0",
"opener": "^1.4.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.0.2",
"rimraf": "^2.5.3",
"tar.gz": "^1.0.5",
"tns-platform-declarations": "^3.0.1",
"tslint": "^5.2.0",
"typescript": "~2.3.2",
"webpack": "~2.5.1",
"webpack-sources": "~0.2.3"
}
}
]
And here's the error.
I'm submitting a ... (check one with "x")
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:
Then after commenting
ExcludeUnusedElementsPlugin
out (as suggested in #372) the build failed on: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
npm install
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
8c892c4
(newest for today)