Nativescript does not compile
IAMtheIAM opened this issue · 6 comments
Clean git clone, on both linux and windows, I get the same error when running npm run android
Error: Could not resolve /data/data/com.domain.project/files/app/app/home/components/home/home.component.css. Looked for: /data/data/com.domain.project/files/app/app/home/components/home/home.component.css.
The app installs on the emulator and shows that message. I sucpect it is because
Hook skipped because either bundling or livesync is in progress.
Why is it skipping the typescript and scss compilation hooks?
Executing before-prepare hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from //NativeScript-POC/angular-native-seed/nativescript/hooks/before-prepare/nativescript-dev-sass.js
Hook skipped because either bundling or livesync is in progress.
Executing before-prepare hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Hook skipped because either bundling or livesync is in progress.
Preparing project...
Executing before-prepareJSApp hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/before-prepareJSApp/nativescript-dev-webpack.js
Project successfully prepared (Android)
Executing after-prepare hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/after-prepare/nativescript-dev-android-snapshot.js
Executing after-prepare hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/after-prepare/nativescript-dev-sass.js
Executing after-prepare hook from /NativeScript-POC/angular-native-seed/nativescript/hooks/after-prepare/nativescript-dev-webpack.js
Building project...
Gradle build...
:config phase: createDefaultIncludeFiles
+found plugins: tns-core-modules-widgets
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in /NativeScript-POC/angular-native-seed/nativescript/platforms/android/configurations folder...
:config phase: pluginExtend
+applying configuration from: /NativeScript-POC/angular-native-seed/nativescript/platforms/android/configurations/include.gradle
+applying configuration from: /NativeScript-POC/angular-native-seed/nativescript/platforms/android/configurations/tns-core-modules-widgets/include.gradle
:config phase: addAarDependencies
+adding dependency: /NativeScript-POC/angular-native-seed/nativescript/platforms/android/libs/aar/widgets-release.aar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Project successfully built.
Installing...
Successfully installed on device with identifier 'emulator-5554'.
Successfully transferred all files.
Refreshing application...
Successfully synced application com.domain.project on device emulator-5554.
ActivityManager: Start proc 4862:com.domain.project/u0a83 for activity com.domain.project/com.tns.NativeScriptActivity
JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/com.domain.project/files/app
JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/com.domain.project/files/internal
JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/com.domain.project/files/snapshots/x86
JS: ns-renderer: ERROR BOOTSTRAPPING ANGULAR
JS: ns-renderer: Could not resolve /data/data/com.domain.project/files/app/app/home/components/home/home.component.css. Looked for: /data/data/com.domain.project/files/app/app/home/components/home/home.component.css.
JS:
JS: Error: Could not resolve /data/data/com.domain.project/files/app/app/home/components/home/home.component.css. Looked for: /data/data/com.domain.project/files/app/app/home/components/home/home.component.css.
JS: at FileSystemResourceLoader.resolve (file:///data/data/com.domain.project/files/app/tns_modules/nativescript-angular/resource-loader.js:33:19) [<root>]
JS: at FileSystemResourceLoader.get (file:///data/data/com.domain.project/files/app/tns_modules/nativescript-angular/resource-loader.js:19:33) [<root>]
JS: at DirectiveNormalizer._fetch (file:///data/data/com.domain.project/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:3186:43) [<root>]
JS: at file:///data/data/com.domain.project/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:3382:41 [<root>]
JS: at Array.map (native) [<root>]
JS: at DirectiveNormalizer._loadMissingExternalStylesheets (file:///data/data/com.domain.project/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:3381:14) [<root>]
JS: at DirectiveNormalizer._normalizeTemplateMetadata (file:///data/data/com.domain.project/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:3293:36) [<root>]
JS: at file:///data/data/com.domain.project/files/app/tns_modules/@angular/compiler/bundles/compiler.umd.js:3221:112 [<root>]
JS: at Function.drainMicroTaskQueue (file:///data/data/com.domain.project/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:593:35) [<root>]
@IAMtheIAM - how did you resolve this? Experiencing same issue.
I did a lot so its hard to say exactly what solved it. Upgrading to latest nativescript 4.1.2 and getting all the NPM packages in sync version wise with each other helped it. I also was using nativescript-angular and upgraded that, and ejected my project using ng eject
so I could change the actual webpack config. It was a difficult setup, but now is working smoothly.
I can share a code repo if that would help. It is basically a slight fork of angular-native-seed that I got working with latest nativescript.
@IAMtheIAM Would you mind to share the code repo (the seed fork)? I've been trying to solve this issue for hours.. thx!
@sgbtz Sure, it will take me some time to get it in a shareable state, i.e. remove sensitive info from the app. So within around 1 week and it should be up and I will share a link.
Is this maybe related to #90 and you @IAMtheIAM can provide an solution to it?
For me it ended up being an error in the scss. (a reference to a non-existing variable). The error was being outputted to the terminal but the terminal is then cleared before you have time to see the error. It helped to output the logs to a file instead of having them show in the terminal, and then reading through them to see what the error was...