I'm following the official getting started with NativeScript/Angular and working on this repo when I do tns run android I get the following:
Executing before-watch hook from /Projects/course-exercise-files-nativescript-angular-getting-started-guide/chapter2/02_07_end/Groceries/hooks/before-watch/nativescript-dev-sass.js
Found peer node-sass
No input file was found.
SASS compiler failed with exit code 1
My node version is: 10.15.1 on a Mac OS Mojave 10.14.2
Here is my package.json :
{
"nativescript": {
"id": "org.nativescript.Groceries",
"tns-android": {
"version": "5.0.0"
},
"tns-ios": {
"version": "5.0.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"#angular/animations": "7.0.0",
"#angular/common": "7.0.0",
"#angular/compiler": "7.0.0",
"#angular/core": "7.0.0",
"#angular/forms": "7.0.0",
"#angular/http": "7.0.0",
"#angular/platform-browser": "7.0.0",
"#angular/platform-browser-dynamic": "7.0.0",
"#angular/router": "7.0.0",
"nativescript-angular": "7.0.0",
"nativescript-theme-core": "1.0.4",
"reflect-metadata": "0.1.10",
"rxjs": "6.3.0",
"tns-core-modules": "5.0.2",
"zone.js": "0.8.4"
},
"devDependencies": {
"#nativescript/schematics": "~0.4.0",
"codelyzer": "~4.5.0",
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.18.0",
"tslint": "~5.11.0",
"typescript": "^3.1.6",
"#angular/compiler-cli": "~7.0.0",
"#ngtools/webpack": "~7.0.0"
},
"readme": "NativeScript Application"
}
I tried many suggestions on other issues discussion but without success.
You will see that error only when you don't have even one SCSS file in your project. Add at least one SCSS file to your project and the error should go away.
Related
We have an app written in NativeScript Angular and based on BottomNavigation and TabView.
I've posted before about issues we have had building our app after migrating from NativeScript 6 to 8.
I can't share our code base so I have taken the legacy code in {N} 6 and stripped out all of our own components to leave just the bare bones.
There is a public repo here: https://github.com/syborp/testapp
It builds and runs fine in {N} 6 and there is a screenshot on the GitHub README.
When we migrate to {N} 8 we keep ending up at this error.
Searching for devices...
Preparing project...
webpack is watching the files...
C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40
throw new Error("The target entry-point \"" + invalidTarget.entryPoint.name + "\" has missing dependencies:\n" +
^
Error: The target entry-point "undefined" has missing dependencies:
- nativescript-angular/element-registry
at TargetedEntryPointFinder.findEntryPoints (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
at C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\execution\single_process_executor.js:28:29)
at C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:59
at SyncLocker.lock (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
at SingleProcessExecutorSync.execute (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
at Object.mainNgcc (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\src\main.js:74:25)
at Object.process (C:\Users\user\testapp\node_modules\#angular\compiler-cli\ngcc\index.js:29:23)
at NgccProcessor.processModule (C:\Users\user\testapp\node_modules\#ngtools\webpack\src\ngcc_processor.js:175:16)
at C:\Users\user\testapp\node_modules\#ngtools\webpack\src\ivy\host.js:146:18
at C:\Users\user\testapp\node_modules\#ngtools\webpack\src\ivy\host.js:76:24
at Array.map (<anonymous>)
at Object.host.resolveModuleNames (C:\Users\user\testapp\node_modules\#ngtools\webpack\src\ivy\host.js:74:32)
at actualResolveModuleNamesWorker (C:\Users\user\testapp\node_modules\typescript\lib\typescript.js:109497:133)
at resolveModuleNamesWorker (C:\Users\user\testapp\node_modules\typescript\lib\typescript.js:109760:26)
at resolveModuleNamesReusingOldState (C:\Users\user\testapp\node_modules\typescript\lib\typescript.js:109857:24)
Executing webpack failed with exit code 1.
It sounds like the entry point main.ts cannot be found but I think it looks ok in package.json.
"description": "Test App",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"scripts": {
"lint": "tslint \"app/**/*.ts\""
},
"dependencies": {
"#angular/animations": "^12.2.5",
"#angular/common": "^12.2.5",
"#angular/compiler": "^12.2.5",
"#angular/core": "^12.2.5",
"#angular/forms": "^12.2.5",
"#angular/http": "8.0.0-beta.10",
"#angular/platform-browser": "^12.2.5",
"#angular/platform-browser-dynamic": "^12.2.5",
"#angular/router": "^12.2.5",
"#master.technology/permissions": "^2.0.1",
"#nativescript/angular": "^12.2.0",
"#nativescript/core": "~8.1.1",
"#nativescript/fingerprint-auth": "^8.0.0",
"nativescript": "^6.5.0",
"nativescript-app-sync": "^2.0.0",
"nativescript-bottom-navigation": "^2.0.5",
"nativescript-camera": "^4.0.2",
"nativescript-drop-down": "^5.0.6",
"nativescript-fancyalert": "^3.0.9",
"nativescript-fingerprint-auth": "^7.0.2",
"nativescript-fontawesome": "^1.0.0",
"nativescript-gradient": "^2.0.1",
"nativescript-imagepicker": "^7.1.0",
"nativescript-iqkeyboardmanager": "^1.5.1",
"nativescript-modal-datetimepicker": "^1.1.4",
"nativescript-pdf-view": "^2.1.0",
"nativescript-permissions": "^1.3.12",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-ui-listview": "^10.0.2",
"reflect-metadata": "~0.1.10",
"ruby": "^0.6.1",
"rxjs": "~7.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^13.2.5",
"#angular/cli": "^12.2.5",
"#angular/compiler-cli": "^12.2.5",
"#nativescript/android": "~8.1.1",
"#nativescript/webpack": "~5.0.0",
"#ngtools/webpack": "^12.2.5",
"#types/node": "14.6.2",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"codelyzer": "~4.5.0",
"extract-text-webpack-plugin": "~3.0.2",
"lazy": "1.0.11",
"sass": "~1.39.0",
"tslint": "~5.12.1",
"typescript": "~4.3.5",
"uglifyjs-webpack-plugin": "^2.2.0"
},
"main": "./app/main.ts"
}
Or is it a webpack issue?
Any advice much appreciated.
TIA.
I have set up the RadSideDrawer as in Telerik documentation. App builds and loads successfully but sidedrawer content is not shown and when trying to swipe the screen to open the sidedrawer application crashes with following error:
An uncaught Exception occurred on "main" thread.
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.FrameLayout.setVisibility(int)' on a null object reference
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.handleOnDown(RadSideDrawer.java:460)
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.onGesture(RadSideDrawer.java:438)
at com.telerik.android.primitives.widget.sidedrawer.RadSideDrawer.onInterceptTouchEvent(RadSideDrawer.java:420)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2109)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2843)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9527)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4248)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4101)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3647)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3700)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3666)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3792)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3674)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3849)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3647)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3700)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3666)
This is package json file:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.app",
"tns-android": {
"version": "3.1.1"
}
},
"dependencies": {
"#angular/animations": "~4.1.0",
"#angular/common": "~4.1.0",
"#angular/compiler": "~4.1.0",
"#angular/core": "~4.1.0",
"#angular/forms": "~4.1.0",
"#angular/http": "~4.1.0",
"#angular/platform-browser": "~4.1.0",
"#angular/router": "~4.1.0",
"moment": "^2.18.1",
"nativescript-angular": "~3.1.0",
"nativescript-cardview": "^2.0.2",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-telerik-ui": "^3.0.4",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.3.0",
"tns-core-modules": "~3.1.0",
"underscore": "^1.8.3",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.25.0",
"babel-types": "6.25.0",
"babylon": "6.17.4",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.5.0",
"tslib": "^1.7.1",
"typescript": "~2.2.1"
}
}
I have installed nativescript-ng2-drawer-seed and it works correctly. I am missing something but i cannot find out. Any help would be appreciated. Thanks
Solved the problem. Just import NativeScriptUISideDrawerModule in the module of the page you are using the sidedrawer. Or just put it in an Angular Shared Module.
I have an Angular2 app which worked perfectly fine until two days ago. When I tried to build the solution in Visual Studio 2015, I got 10 errors:
Build: Cannot find type definition file for 'hammerjs'.
Build: Cannot find type definition file for 'jasmine'.
Build: File (...)/wwwroot/lib/ng2-translate/index.ts' not found.
And 6 more about various files in ng2-translate not found.
Surprisingly, when I build my app by dotnet run command, it works well.
I updated everything by npm-check-updates -u, but it didn't change anything.
My package.json:
{
"version": "1.0.0",
"name": "CarMarket",
"private": true,
"dependencies": {
"#angular/common": "~4.0.3",
"#angular/compiler": "~4.0.3",
"#angular/core": "~4.0.3",
"#angular/forms": "~4.0.3",
"#angular/http": "~4.0.3",
"#angular/platform-browser": "~4.0.3",
"#angular/platform-browser-dynamic": "~4.0.3",
"#angular/router": "~4.0.3",
"#angular/upgrade": "~4.0.3",
"angular-in-memory-web-api": "~0.3.1",
"body-parser": "1.17.1",
"bootstrap": "3.3.7",
"chart.js": "^2.5.0",
"core-js": "^2.4.1",
"es6-shim": "^0.35.0",
"fancybox": "3.0.0",
"jquery": "3.2.1",
"ng2-charts": "^1.5.0",
"ng2-translate": "^5.0.0",
"reflect-metadata": "^0.1.8",
"rxjs": "5.3.0",
"systemjs": "0.20.12",
"zone.js": "^0.8.9"
},
"devDependencies": {
"#types/node": "^7.0.13",
"del": "2.2.2",
"gulp": "3.9.1",
"gulp-typescript": "3.1.6",
"gulp-watch": "4.3.11",
"merge": "1.2.0",
"typescript": "^2.0.10",
"typings": "^2.1.1"
},
"scripts": {
"postinstall": "typings install"
}
}
What might be the reason of those errors? H
As the error clearly states, you are missing type definitions for hammerjs and jasmine. You can either add them to your typings definition file, or you can install the types packages directly:
npm install --save #types/hammerjs
npm install --save #types/jasmine
I just have installed Nativescript on my macOS Sierra 10.12.12. But when i enter the command: tns platfrom add ios I get the following error message:
*Version strings are not in the same format*
*#platform add*
When I enter the same command for Android everything works fine.
tns doctor gives me the following feedback:
*Your components are up-to-date.*
*No issues were detected.*
Log Trace:
ns platform add ios --log trace > log.txt
Error: Version strings are not in the same format
at Object.versionCompare (/usr/local/lib/node_modules/nativescript/lib/common/helpers.js:111:15)
at /usr/local/lib/node_modules/nativescript/lib/services/ios-project-service.js:92:25
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:69:47
at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:249:26)
at FiberFuture.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:565:10)
at .each.platform (/usr/local/lib/nodemodules/nativescript/lib/services/platform-service.js:55:58)
at arrayEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:451:11)
at Function.forEach (/usr/local/lib/node_modules/nativescript/node_modules/lodash/lodash.js:8634:14)
#Brad Martin
This is my package.json file:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.HelloWorld",
"nativescript-teststudio-variables": {
"IOS_APP_URL": "telerikmt1"
},
"tns-android": {
"version": "2.5.0"
}
},
"dependencies": {
"#angular/common": "2.4.3",
"#angular/compiler": "2.4.3",
"#angular/core": "2.4.3",
"#angular/forms": "2.4.3",
"#angular/http": "2.4.3",
"#angular/platform-browser": "2.4.3",
"#angular/platform-browser-dynamic": "2.4.3",
"#angular/router": "3.4.3",
"nativescript-angular": "1.4.0",
"nativescript-teststudio": "^1.1.4",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.0.1",
"tns-core-modules": "^2.5.1"
},
"devDependencies": {
"babel-traverse": "6.23.1",
"babel-types": "6.23.0",
"babylon": "6.16.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.3.5",
"typescript": "~2.1.0",
"zone.js": "~0.7.2"
}
}
Recently I've updated my NativeScript CLI to 2.1.0 & installed Telerik UI plugin. After that. my app build getting fail with the error "actual and formal argument lists differ in length".
Screenshot -
package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.bhramaan",
"tns-android": {
"version": "2.1.1"
}
},
"dependencies": {
"#angular/common": "2.0.0-rc.1",
"#angular/compiler": "2.0.0-rc.1",
"#angular/core": "2.0.0-rc.1",
"#angular/http": "2.0.0-rc.1",
"#angular/platform-browser": "2.0.0-rc.1",
"#angular/platform-browser-dynamic": "2.0.0-rc.1",
"#angular/platform-server": "2.0.0-rc.1",
"#angular/router-deprecated": "2.0.0-rc.1",
"nativescript-angular": "0.1.1",
"nativescript-plugin-firebase": "^3.0.1",
"tns-core-modules": "^2.0.0"
},
"devDependencies": {
"babel-traverse": "6.9.0",
"babel-types": "6.9.0",
"babylon": "6.8.0",
"filewalker": "0.1.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^1.8.10"
}
}
I've also removed platform & added once again. But, still now no luck.
Here is your problem:
"tns-android": {
"version": "2.1.1"
}
"tns-core-modules": "^2.0.0"
You must have TNS/NativeScript-CLI, TNS-Common-Core and the TNS-Platforms the same version.
Type: tns info to easily see what versions you are.
Here are the upgrade steps:
To upgrade NativeScript command line
npm install -g nativescript#latest
To Upgrade the NativeScript Common Core library
npm install tns-core-modules#latest --save
To Upgrade the platform (replace android with ios for iOS)
tns platform remove android
tns platform add android