Skip to content

SyntaxError: Unexpected end of JSON input on upgrading to @nativescript/core 8.8 #10612

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

Open
3 tasks done
jasreenka opened this issue Aug 27, 2024 · 3 comments
Open
3 tasks done

Comments

@jasreenka
Copy link

Issue Description

Getting "Unexpected end of JSON input error" on updating to nativescript/core version 8.8.0 and above. Issue occurs on iOS. Some http get requests succeed but others that yused to work just fine and breakign with the mentioned error.
Have to update to 8.8.2 to get android support for SDK 34.

Reproduction

Update @nativescript/core to ~8.8.0
ns debug ios

Relevant log output (if applicable)

No response

Environment

OS: macOS 14.3
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Shell: /bin/zsh
node: 16.16.0
npm: 8.11.0
nativescript: 8.8.1

android

java: 17.0.12
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

ios

xcode: 15.2/15C500b
cocoapods: 1.15.2
python: 3.12.4
python3: 3.12.4
ruby: 2.6.10
platforms:

  • DriverKit 23.2
  • iOS 17.2
  • macOS 14.2
  • tvOS 17.2
  • visionOS 1.0
  • watchOS 10.2

Package.json

"dependencies": {
"@angular-devkit/build-angular": "^13.3.5",
"@angular/animations": "~13.2.0",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"@nativescript-community/perms": "^2.3.0",
"@nativescript-community/ui-document-picker": "^1.1.12",
"@nativescript/angular": "^13.0.0",
"@nativescript/biometrics": "^1.3.1",
"@nativescript/camera": "^5.0.12",
"@nativescript/contacts": "^2.0.4",
"@nativescript/core": "~8.8.0",
"@nativescript/datetimepicker": "2.1.9",
"@nativescript/directions": "^2.0.0",
"@nativescript/email": "^2.0.3",
"@nativescript/firebase": "^11.1.3",
"@nativescript/imagepicker": "2.0.2",
"@nativescript/iqkeyboardmanager": "^2.0.0",
"@nota/nativescript-webview-ext": "^8.0.1",
"@nstudio/nativescript-carousel": "^8.0.3",
"@nstudio/nativescript-checkbox": "^2.0.4",
"@nstudio/nativescript-exoplayer": "^5.1.0",
"@nstudio/nativescript-filterable-listpicker": "^3.0.2",
"@nstudio/root-detection": "^2.0.1",
"@proplugins/nativescript-cardview": "^5.0.0",
"@proplugins/nativescript-drop-down": "^9.0.2",
"@proplugins/nativescript-masked-text-field": "^6.0.0",
"@proplugins/nativescript-permissions": "^1.5.4",
"android-in-app-review": "file:plugins/android-in-app-review",
"dayjs": "^1.10.4",
"intl": "^1.2.5",
"js-base64": "^3.6.0",
"nativescript-clipboard": "^2.1.1",
"nativescript-mediafilepicker": "^4.0.2",
"nativescript-pdf-view": "^3.0.0-1",
"nativescript-phone": "^2.0.0",
"nativescript-ui-sidedrawer": "^10.0.0",
"reflect-metadata": "~0.1.10",
"rxjs": "~7.5.0",
"zone.js": "^0.11.4"
},
"devDependencies": {
"@angular/cli": "~13.2.0",
"@angular/compiler-cli": "~13.2.0",
"@nativescript/android": "~8.8.0",
"@nativescript/ios": "~8.8.0",
"@nativescript/schematics": "^11.0.0",
"@nativescript/theme": "^3.0.2",
"@nativescript/types": "~8.8.0",
"@nativescript/webpack": "~5.0.18",
"@ngtools/webpack": "~13.2.0",
"@types/chai": "^4.2.15",
"@types/js-base64": "^3.0.0",
"@types/mocha": "^8.2.1",
"@types/node": "^14.14.31",
"@types/webpack-env": "^1.16.0",
"axios": "^0.21.1",
"browserstack-local": "^1.4.8",
"chai": "^4.3.0",
"codelyzer": "^6.0.1",
"date-fns": "^2.18.0",
"extract-loader": "^5.1.0",
"file-loader": "^6.2.0",
"fs-extra": "^9.1.0",
"listr": "^0.14.3",
"mb": "file:scripts/mb",
"mocha": "^10.0.0",
"mochawesome": "^6.2.2",
"nanoid": "^3.1.20",
"nanoid-dictionary": "^4.2.0",
"nativescript": "^8.2.0",
"nativescript-dev-appium": "^6.1.3",
"npm-check": "^5.9.2",
"npm-run-all": "^4.1.5",
"open": "^7.4.2",
"patch-package": "^6.4.7",
"prettier": "^2.2.1",
"puppeteer": "^8.0.0",
"sass": "^1.50.0",
"strip-ansi-stream": "^1.0.0",
"ts-node": "^10.7.0",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"typescript": "~4.5.5",
"xcode": "^3.0.1",
"yargs": "^16.2.0"
}

Please accept these terms

@jasreenka jasreenka added the bug-pending-triage Reported bug, pending triage to confirm. label Aug 27, 2024
@NathanWalker
Copy link
Contributor

Could you share the http code being used in the area where you’re seeing this?

@NathanWalker NathanWalker added question needs more info and removed bug-pending-triage Reported bug, pending triage to confirm. labels Aug 27, 2024
@jasreenka
Copy link
Author

this.http.get<any>('example/api').subscribe((result: any)=>{
})

Sorry, cannot share the API name. it is not just this one, there are multiple that are giving the json error instead of the response
this.http is HttpClient from '@angular/common/http'.

Nothing was changed on this side. Same API call works on nativescript ~8.7.0 but breaks with 8.8

@jasreenka
Copy link
Author

Different issue on android as well :
On launching the app, I get the following error with same package.json as mentioned before. Please help!

Installing on device emulator-5554... Successfully installed on device with identifier 'emulator-5554'. Restarting application on device emulator-5554... System.err: An uncaught Exception occurred on "main" thread. System.err: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function System.err: Error calling module function System.err: ReferenceError: android is not defined System.err: File: (file: src/webpack/bootstrap:27:0) System.err: System.err: StackTrace: System.err: ./node_modules/@nativescript/core/utils/constants.android.js(file: node_modules/@nativescript/core/utils/constants.android.js:1:7) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266) System.err: System.err: System.err: ReferenceError: android is not defined System.err: File: (file: src/webpack/bootstrap:27:0) System.err: System.err: StackTrace: System.err: ./node_modules/@nativescript/core/utils/constants.android.js(file: node_modules/@nativescript/core/utils/constants.android.js:1:7) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266) System.err: System.err: System.err: ReferenceError: android is not defined System.err: System.err: StackTrace: System.err: ./node_modules/@nativescript/core/utils/constants.android.js(file: node_modules/@nativescript/core/utils/constants.android.js:1:7) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266) System.err: System.err: System.err: ReferenceError: android is not defined System.err: File: (file: src/webpack/bootstrap:27:0) System.err: System.err: StackTrace: System.err: ./node_modules/@nativescript/core/utils/constants.android.js(file: node_modules/@nativescript/core/utils/constants.android.js:1:7) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266) System.err: System.err: System.err: ReferenceError: android is not defined System.err: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7003) System.err: at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236) System.err: at android.os.Handler.dispatchMessage(Handler.java:106) System.err: at android.os.Looper.loopOnce(Looper.java:205) System.err: at android.os.Looper.loop(Looper.java:294) System.err: at android.app.ActivityThread.main(ActivityThread.java:8177) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971) System.err: Caused by: com.tns.NativeScriptException: Error calling module function System.err: Error calling module function System.err: ReferenceError: android is not defined System.err: File: (file: src/webpack/bootstrap:27:0) System.err: System.err: StackTrace: System.err: ./node_modules/@nativescript/core/utils/constants.android.js(file: node_modules/@nativescript/core/utils/constants.android.js:1:7) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/application.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:5795:74) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/application/index.android.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:6364:70) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/globals/index.js(file: node_modules/@nativescript/core/globals/index.js:316:0) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at fn(file: src/webpack/runtime/hot module replacement:62:0) System.err: at ./node_modules/@nativescript/core/inspector_modules.js(file:///data/data/ca.mybenefits.mobile/files/app/vendor.js:15676:66) System.err: at __webpack_require__(file: src/webpack/bootstrap:24:0) System.err: at __webpack_exec__(file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:21:39) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:71) System.err: at (file: src/webpack/runtime/startup entrypoint:6:0) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:22:47) System.err: at (file:///data/data/ca.mybenefits.mobile/files/app/tns_modules/inspector_modules.js:27:3) System.err: at require(:1:266)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants