You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file:///android_asset/www/js/cordova-media-upload.js: Line 39 : Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0
chromium: [INFO:CONSOLE(39)] "Uncaught (in promise) SyntaxError: Unexpected token u in JSON at position 0", source: file:///android_asset/www/js/cordova-media-upload.js (39)
Specs:
Device: Android Cordova App on Datalogic Memor 10 with Android 8.1.0
Cordova: 8.1.2 ([email protected])
Build on: Ubuntu 20.04
The error throws by calling getMedia. In getMedia the Error gets caught.
The error message is probably caused by the fact that in line 39 of your cordova-media-upload.jsthis.optionsObj is "undefined". Therefore, also "Unexpected token u in JSON at position 0". I can not say why it would be "undefined"…
But I could also be wrong, I haven't quite figured out your code yet.
I can't get past the error.
Please help.
The text was updated successfully, but these errors were encountered:
Hey @Stakdek, have you considered using CapacitorJS instead of Cordova first of all? I would highly recommend switching to Capacitor, as Cordova seems to be dying out.
As for your error, I remember getting that error when something was wrong with my AJAX call. It could also be that one of the Cordova plugins is broken.
As I stated though, switching to Capacitor is honestly the best move in my opinion. It's a much better ecosystem to work with and is basically the successor to Cordova.
Hey @D-Marc1!
The switch to CapacitorJS would not work for me…
In my code, I am not using any AJAX call, the code above is the only call it gets. The initial call is an only a Button.
Do you know which of the Cordova plugins could be broken?
The switch to CapacitorJS would escalate in work for me… so this is no option for me.
I think it might be the VideoEditor plugin where it creates the thumbnail, specifically here. I remember when I was using Cordova there were annoyances over when I would have to append file://. It could also be this line, as I also had to append it there.
Error-Message:
Specs:
Device: Android Cordova App on Datalogic Memor 10 with Android 8.1.0
Cordova: 8.1.2 ([email protected])
Build on: Ubuntu 20.04
Code:
Already tried with
The error throws by calling
getMedia
. IngetMedia
the Error gets caught.The error message is probably caused by the fact that in line 39 of your
cordova-media-upload.js
this.optionsObj
is "undefined". Therefore, also "Unexpected token u in JSON at position 0". I can not say why it would be "undefined"…But I could also be wrong, I haven't quite figured out your code yet.
I can't get past the error.
Please help.
The text was updated successfully, but these errors were encountered: