question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RN error : Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)

See original GitHub issue

Environment

Environment: OS: Windows 10 Node: 10.7.0 Yarn: 1.9.4 npm: 6.1.0 Watchman: 4.9.4 Xcode: N/A Android Studio: 3.1.3

Packages: (wanted => installed) react-native-cli: 2.0.1 react-native: 0.55.4

Description

I meet this error when I run command: react-native run-android . Although it show me Build successful. image image And in android studio ,the logcat shows words below:

8-08 16:41:20.296 19265-19412/com.securemail E/ReactNativeJNI: Got JS Exception: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
08-08 16:41:20.298 19265-19412/com.securemail E/unknown:ReactNative: Exception in native call from JS
    com.facebook.react.devsupport.JSException: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:815)
        at android.os.Handler.dispatchMessage(Handler.java:104)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:224)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: com.facebook.jni.CppException: Unexpected token '*' (http://localhost:8081/index.delta?platform=android&dev=true&minify=false:94148)
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:815) 
        at android.os.Handler.dispatchMessage(Handler.java:104) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) 
        at android.os.Looper.loop(Looper.java:224) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) 
        at java.lang.Thread.run(Thread.java:818) 
08-08 16:41:20.300 19265-19412/com.securemail E/unknown:ReactNative: Exception in native call
    java.lang.RuntimeException: Error calling AppRegistry.runApplication
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
        at android.os.Handler.handleCallback(Handler.java:815)
        at android.os.Handler.dispatchMessage(Handler.java:104)
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
        at android.os.Looper.loop(Looper.java:224)
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: com.facebook.jni.CppException: Could not get BatchedBridge, make sure your bundle is packaged correctly
        at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method) 
        at android.os.Handler.handleCallback(Handler.java:815) 
        at android.os.Handler.dispatchMessage(Handler.java:104) 
        at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) 
        at android.os.Looper.loop(Looper.java:224) 
        at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) 
        at java.lang.Thread.run(Thread.java:818) 

Someone said delete the files in assets and run under command can help, but I tried it and no use, feeling confused.

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

I tested other mobilephone but no use. Please help me ,thanks a lot.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

8reactions
beqaMeqvabishvilicommented, Apr 1, 2019

Just fixed the problem after hours of headache. for me, the problem was one of my dependencies was using ** operator which was not recognized by my babel compiler (apologies if I misused the terms, I am not very experienced with these staff). so I went there and changed ** operator with the regular Math.pow().

for me the file that was causing the issue was \node_modules\react-native-elements\src\tooltip\getTooltipCoordinate.js third line, in react-native-elements library.

check your last installed libraries for same operator and replace. probably not the best way to fix it but at least you’ll know what’s causing the issue.

0reactions
stale[bot]commented, Sep 26, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

error Unexpected token = after upgrading from RN 0.64.2 to ...
I had this issue after upgrading RN to 65.1. As per my investigation it is caused by an incorrect Node.js version used during...
Read more >
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >
SyntaxError: Unexpected token < in JSON at position 0
SyntaxError : Unexpected token < in JSON at position 0. Im trying to get a single object from the api, it worked fine...
Read more >
syntax error unexpected token if - Codecademy
It is returning a syntax error unexpected token if var userChoice = prompt("Do you choose rock, paper or scissors?"); var computerChoice = Math.random(); ......
Read more >
How to Fix SyntaxError: Unexpected token < in JSON at ...
parse: unexpected character at line 1 column 1 of the JSON data. JSON Parse error: Unrecognized token '<'. Summary. These errors indicate your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found