React Native Error: Uncaught JavaScript Exception - Invalid Syntax

Encountering a strange error when trying to launch my RN app on iOS 8:

Unhandled JS Exception: SyntaxError

No additional information provided. Has anyone else come across this issue?
Interestingly, the application runs fine on iOs 9+.

xCode version: 8.1. Logs from xCode:

2016-12-07 16:33:57.073 [info][tid:main][RCTBatchedBridge.m:73]     Initializing <RCTBatchedBridge: 0x7fc36c72ae80> (parent: <RCTBridge: 0x7fc36c060920>, executor: RCTJSCExecutor)
2016-12-07 16:34:29.369 [warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:509] Failed to execute source code: Unhandled JS Exception: SyntaxError
2016-12-07 16:34:29.369 [fatal][tid:main] Unhandled JS Exception: SyntaxError

My package.json:

{
    "name": "...",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "fbjs": "^0.8.6",
    "moment": "^2.16.0",
    "react": "15.3.2",
    "react-native": "^0.37.0",
    "react-native-chart": "^1.0.8-beta",
    "react-native-gifted-chat": "0.0.10",
    "react-native-image-picker": "^0.23.0",
    "react-native-image-progress": "^0.6.0",
    "react-native-locale": "0.0.11",
    "react-native-material-kit": "^0.3.3",
    "react-native-message-bar": "^1.6.0",
    "react-native-modal-datetime-picker": "^3.0.0",
    "react-native-modal-picker": "0.0.16",
    "react-native-router-flux": "^3.37.0",
    "react-native-timer": "^1.1.2",
    "shortid": "^2.2.6"
  },
  "jest": {
    "preset": "jest-react-native"
  },
  "devDependencies": {
    "babel-jest": "17.0.0",
    "babel-preset-react-native": "1.9.0",
    "jest": "17.0.1",
    "jest-react-native": "17.0.1",
    "react-test-renderer": "15.3.2",
    "whatwg-fetch": "1.0.0"
  }
}

Node, npm and react-native versions:

adamt@Dev-2 ~/D/G/myApp> npm -v
4.0.2
adamt@Dev-2 ~/D/G/myApp> node -v
v4.4.4
adamt@Dev-2 ~/D/G/myApp> react-native -v
react-native-cli: 1.2.0
react-native: 0.37.0

Any insights into why this error is occurring would be greatly appreciated!

Answer №1

An error has been identified in React Native version 0.39.

To resolve this issue, it is recommended to disable 'use strict'; on line 30 in node_modeles/react-native/Libraries/Core/InitializeCore.js:

// 'use strict'; Fix for RN 0.39 - https://github.com/facebook/react-native/issues/11389

Alternatively, you can revert back to React Native version 0.38.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Enclosing Functions Within Anonymous Functions - JavaScript

Recently, I've delved into the world of using anonymous JavaScript functions and have a query regarding their usage with event listeners through jQuery. For instance, I have the following event listener that triggers actions upon the submission of a ...

Is there a way to extract information from an external XML document and incorporate it into an HTML file?

I am attempting to extract information from an XML file that is not stored on my website's server. My goal is to utilize this data for various purposes, such as generating charts. One specific example involves using weather data from an XML file locat ...

Displaying entries of input data

I have an application that includes a modal window with filters, but I am looking to add another type of filter. However, I am struggling with implementing it in React and would appreciate any help with the code or recommended links. Essentially, I want t ...

transmitting information in the form of form-data

I am facing a dilemma with a post request, where I need to send a body in the form of form-data. The current data is stored in an NSMutableDictionary like this: contacts ( { Images = ( "http://otrackapi.omegasoftware.ca/ActStaf ...

Determine whether a property of an object has been altered

Two applications, one in C++ and the other in node-webkit, are communicating through OSC. Whenever I press the plus sign (+), a value increments, and when I press the minus sign (-), that value decrements. The output is then sent to the node-webkit instanc ...

Remove a specific date entry from the database using VUE JS and Axios

I am encountering a challenge with Vuejs as I work on a To-Do list. The tasks need to be stored in a MySQL database, and I also want the ability to delete tasks. While I have succeeded in importing and creating data, I'm facing difficulty in deleting ...

The Ajax URL is failing to connect with the controller through IIS

I am facing an issue where the application gets stuck in the Home controller when running it on IIS. It doesn't progress to the next controller (Data controller) as specified in the URL. However, when I run it in debug mode, everything works fine. How ...

What could be causing my for loop to not function properly within the ngOnInit lifecycle hook?

I am attempting to create a nested loop structure in order to access an array that is inside an object within an array of objects, and then store this data into a new array. My issue arises as the first loop executes successfully but the second one does no ...

Adjust the size of the input field as text is being typed in

Can a text input box be automatically resized as text is entered? I've been looking online but haven't come across any solutions. ...

Importing libraries in TypeScript and JavaScript are not done in the same manner

As I create my own library, I aim for it to be compatible with both javascript and typescript. tsconfig.json { "compilerOptions": { "target": "es2017", "module": "commonjs", &qu ...

The functionality of Jquery appears to be malfunctioning on the Drupal platform, although it performs

I've built a jQuery carousel that is fully functional when tested locally, but encounters issues when uploaded to a Drupal platform. Surprisingly, the jQuery functions properly when entered through the Console. Here's the jQuery code: carousel = ...

React Conditional State Setting

I have created a component that dynamically changes its background color based on the rating of a school. According to the specifications, if the school's rating falls between 1 and 3, the background color should be orange. For ratings between 4 and ...

Best method to preserve data in a ViewController when it reappears

I am currently working with two ViewControllers: MainVC and SettingsVC. The behavior of MainVC is dependent on a value that is set at runtime within SettingsVC. I am successfully passing the value from SettingsVC to MainVC using prepareForSegue(). However ...

Steps for creating a file selection feature in Chonky.js

I recently integrated the Chonky library into my application to build a file explorer feature. One challenge I am facing is figuring out how to select a file and retrieve its unique ID when the user double clicks on it. const [files, setFiles] ...

Traverse through deeply nested arrays of objects with varying levels of child nodes

When working with a multi-node tree, adding a new row often requires obtaining the reference of that specific row by its id in order to trigger the rowclick event programmatically. In this scenario, if a row with the id 9 needs to be added, the challenge ...

"Integrating Vuetify into a single-spa Vue application: Step-by-step

vue 2.6.14 vuetify 2.6.9 What is the process for integrating vuetify into a vue application? I am attempting to import my project into another project as a microfrontend application, but encountering issues. Here are the steps I followed: Create-single- ...

Is it a mistake to gather errors together and send them to the promise resolve in JavaScript?

When processing a list in a loop that runs asynchronously and returns a promise, exiting processing on exception is not desired. Instead, the errors are aggregated and passed to the resolve callback in an outer finally block. I am curious if this approach ...

Updating two separate <DIV> elements with a single AJAX request

Can two different targeted DIVs be updated simultaneously using a single ajax call? Consider the index.html code snippet below: <script> xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.rea ...

Can VueJS 1 and 2 be integrated within the same package.json configuration?

At the moment, my JavaScript files are using VueJS 1. However, I am preparing to work on a new section of the system and want to switch to VueJS 2. ...

Button click event not triggering JavaScript execution

I am experimenting with HTML, PHP and JS and have encountered a problem. Here is my code: <html> <head> <title> Dummy Code </title> <script> sendMail(){ <?php $to = '<a href="/cdn-cgi/l/email-protection" class ...