What is a V8Exception error? - javascript

I'm not sure what this error is coming from, nor what it is or what it means. Here is the error I get:
[ERROR] : V8Exception: Exception occurred at undefined:1: Uncaught SyntaxError: Unexpected token u
Now, I am creating an HTML 5 Cross platform (Android/iOS) application using Titanium Studio IDE. I'm not sure if this is an Android specific error or a Titanium Studio specific error. I know it can't be iOS because I only get this error when I am trying to test the app on Android tablet. (The app installs and runs on the device though).
NOTE: The code I am working on is proprietary so I can't show it. But what I'm mostly interested in an explanation of this error. Generally, What is this error and when does some one come across it?

Related

Magento 2 cms backend javascript error Uncaught SyntaxError: Invalid or unexpected token

Suddenly I am having javascript error and cannot edit any cms page (cms/page/edit/page_id/45) or block. I have been trying to solve this for the past week with no success. I have also tried removing the modules that I have installed recently.
I did not touch any core files and I have updated file permissions but still get this error below in chrome console from the core static files
VM6148:68 Uncaught SyntaxError: Invalid or unexpected token
at template (template.js:79:36)
at render (template.js:140:24)
at iterate (template.js:236:33)
at Function._.each._.forEach (underscore.js:150:9)
at Object.template (template.js:206:15)
at UiClass.initConfig (class.js:89:28)
at UiClass._super (wrapper.js:106:35)
at UiClass.initConfig (abstract.js:123:18)
at UiClass.initConfig (wrapper.js:109:34)
at UiClass._super (wrapper.js:106:35)
Image showing spinner and javascript error
In my case, it was a database issue due to js injection. Patching a 3rd party extension fixed the issue.

Unhandled JS Exception: Unexpected token '<' no stack

I started facing an issue with running my react native application in iOS device
Unhandled JS Exception: Unexpected Token '<' no stack
This started happening after i generated the main.jsbundle in react native application using the below curl command
curl http://localhost:8081/index.ios.bundle -o main.jsbundle
and added this file in xcode project. This seems to like an issue with parsing of the main.jsbundle file which i added in react-native.
Prior to the above process i tried running the application with localhost:8081 for finding the jsbundle but doesn't help me for ios devices. Code in my develop branch is working fine, but same develop code in my feature branch doesn't work with main.jsbundle.
Did anyone faced similar issue with running react native code in iOS devices.
The response you're getting is most likely in HTML format, which starts with a <. When you try to parse this response (presumably with res.json()) an exception is thrown, because a json string cannot start with a <
Try debugging your program and check exactly what the response you're getting is

Uncaught SyntaxError: Unexpected reserved word on older android version

I am programming an app using cordova and testing it on android 8.0.0 it works fine.
But on my friend's phone (android 4.4.4) it does not work, I got these errors in the console log.
Uncaught SyntaxError: Unexpected reserved word Widget.js:9
Uncaught SyntaxError: Unexpected reserved word Image.js:8
Uncaught SyntaxError: <unknown message reserved_word> Button.js:7
Uncaught SyntaxError: <unknown message reserved_word> TextArea.js:8
Uncaught SyntaxError: <unknown message reserved_word> Effect.js:8
Uncaught SyntaxError: Unexpected reserved word View.js:9
Uncaught SyntaxError: <unknown message reserved_word> User_interface.js:8
Uncaught SyntaxError: <unknown message reserved_word> Communication.js:8
Uncaught SyntaxError: <unknown message reserved_word> App.js:7
Those errors block on the keyword "class"
Uncaught SyntaxError: Unexpected token ) index.js:16
and also block on :
AndroidFullScreen.immersiveMode(()=>{},()=>{});
Here I think it doesn't recognize the arrow function but i'm not sure.
I would like to know if I can fix it or the phone is just too old for my app?
If you need other information tell me and I will provide them :)
Thanks in advance
Before Android 4.4 cordova was using the old android browser (very old support of html 5).
Starting from android 4.4 the android browser was replaced by Chrome but the version of Chrome used by the webview couldn't be upgraded (version 36 for 4.4).
Since android 5.0, chrome is now in an apk and can be updated.
Arrow functions require a minimum Chrome version of 45, that's why your app doesn't work correctly on your friend's phone.
If want your app to work correctly of phones older than android 5, you can either:
not use too recent javasctipt (check support on caniuse)
use the crosswalk plugin to embed the webview in your app
Crosswalk was supposed to always use the latest version of chromium but unfortunatly the project is no more updated so you will not be able to use the latest javascript updates either. (latest version of Crosswalk uses chromium version 53 wich is much more recent than the 36 used in android 4.4)
The advantage of Crosswaalk is that your app has the same support of html/js/css on all device so you know how your app will behave/look like on all devices.
Using Crosswalk will lead to a much bigger APK so that's not always the best option.
You could also build two different apk versions, one for android <5.0 and one for newer.
Do you know anyone who's forked the original and updated chromium to 55 or higher by chance?

Can error from Javascript cause Selenium tests fail?

I am writing automation test for a Rail app using Selenium, Capybara and Cucumber running on Jenkins. Recently, lots of my tests failed due to error:
unknown error: Cannot read property 'ownerDocument' of undefined
(Session info: chrome=47.0.2526.106)
(Driver info: chromedriver=2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b),platform=Linux 4.0.5 x86_64) (Selenium::WebDriver::Error::UnknownError)
./features/step_definitions/advanced_search.rb:81:in `/^user can see search buttons and links$/'
and in Chrome inspect, I can see a javascript error:
Uncaught TypeError: Cannot read property 'ownerDocument' of undefined
So, I want to know if this javascript error can make my tests failed? This error only appears after clicking on an element. Have anyone experienced this error? How to solve this?
Thanks.
Yes a JS error can cause tests to fail since it means things in the page aren't doing what you'd expect. The Chrome inspect should show you the source of the JS with the error, if it's in your JS you'll need to fix it, if not it may be a bug in chromedriver.

Errors trying to build Cordova Window app

I have a cordova application that runs fine on android, iOS and wp8. Now we would like it to run on windows. I have added the platform using the following command
cordova platform add windows
This adds all the plugins for me, now i build the project using
cordova build windows
For some reason my plugins and other basic features are not working. For example, i have the following cordova plugins installed
cordova plugin list
org.apache.cordova.splashscreen 1.0.0
org.apache.cordova.statusbar 0.1.10
org.apache.cordova.console 0.2.13
org.apache.cordova.camera 0.3.6
I havent tried camera yet, but upon my application starting, i try to hide the splash screen and status bar, and i get these errors
Exception was thrown at line 96, column 9 in
ms-appx://MY.APP.ID/www/plugins/org.apache.cordova.statusbar/src/windows/StatusBarProxy.js
0x800a138f - JavaScript runtime error: Unable to get property
'hideAsync' of undefined or null reference
and
Exception was thrown at line 82, column 9 in
ms-appx://MY.APP.ID/www/plugins/org.apache.cordova.splashscreen/www/windows8/SplashScreenProxy.js
0x80004002 - JavaScript runtime error: No such interface supported
I have even tried to show a console.log, which never shows anymore? I know in WP8 projects you have to change the DEFINE DEBUG flag, but i cannot find this on the new windows project.
To get round console, i thought i would try and show an alert, which you can do with
(new Windows.UI.Popups.MessageDialog("Content", "Title")).showAsync().done();
But i get an error message of
Exception was thrown at line 47, column 9 in
ms-appx://com.measure2improve.m2ianywhere/www/plugins/org.apache.cordova.dialogs/src/windows/NotificationProxy.js
0x80070005 - JavaScript runtime error: Access is denied.
I am obviously missing something here, if someone could let me know what i have missed, would be very much appriecated.

Categories