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.

Unexpected token '.' no stack

See original GitHub issue

🐛 Bug Report

When i’m running react-native run-android while an emulator is on, everything is fine, my app is correctly running. But when I’ve got my device connected via USB and I make the same command, the app builds, installs, but I have the following error : image

To Reproduce

  • running react-native run-android on a connected device

Expected Behavior

The app should run correctly

Environment

  React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 18.04.2 LTS (Bionic Beaver)
      CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
      Memory: 1.86 GB / 15.54 GB
      Shell: 5.4.2 - /usr/bin/zsh
    Binaries:
      Node: 8.15.0 - /usr/bin/node
      Yarn: 1.12.3 - /usr/bin/yarn
      npm: 6.7.0 - /usr/bin/npm
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5264788
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.4 => 0.58.4 
    npmGlobalPackages:
      react-native-cli: 2.0.1

package.json :

{
  "name": "myApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "buffer": "^5.2.1",
    "private-dependency": "git+ssh://git@github.com:private/dependency.git",
    "isomorphic-fetch": "^2.2.1",
    "jwt-decode": "^2.2.0",
    "lodash": "^4.17.11",
    "moment": "^2.24.0",
    "object-path": "^0.11.4",
    "react": "16.6.3",
    "react-native": "0.58.4",
    "react-native-gesture-handler": "^1.0.15",
    "react-native-paper": "^2.11.1",
    "react-native-share": "^1.1.3",
    "react-native-vector-icons": "^6.3.0",
    "react-navigation": "^3.3.0",
    "react-redux": "5.0.5",
    "redux": "3.6.0",
    "redux-form": "7.3.0",
    "redux-persist": "^5.10.0",
    "universal-url": "^2.0.0"
  },
  "devDependencies": {
    "babel-core": "^7.0.0-bridge.0",
    "babel-jest": "24.1.0",
    "jest": "24.1.0",
    "metro-react-native-babel-preset": "0.52.0",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

2reactions
VidyaCKcommented, Dec 4, 2019

I resolved this issue by turning on USB debugging in the android device.

1reaction
mjm918commented, Nov 22, 2019

In my case, unexpected toke ‘<’ no stack

But surprisingly it happens only when I run on Android 9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token '?' no stack in React Native
I was having this exact problem, but only in Android. The problem was caused by my use of a nullish coalescing assignment operator...
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 >
React Native Unexpected token error while running in Emulator
Please click below link to help me ...
Read more >
[Solved]-Unhandled JS Exception: Unexpected token '<' no stack
Coding example for the question Unhandled JS Exception: Unexpected token '<' no stack.
Read more >
expo unexpected token '?' no stack - DEV Community ‍ ‍
expo unexpected token '?' no stack. The command to run is: expo r -c. Top comments (0) ...
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