Unexpected token no stack – android emulator expo

Issue

I get this weird message in android emulator whilst running expo, any idea whats causing this? There seems to be no real stack trace. If I run in debug mode, it works fine which is odd. There’s definitely enough space on the hard disk so don’t think that’s an issue either.

enter image description here

Package.json

{
  "name": "project",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/kanit": "^0.2.2",
    "@expo-google-fonts/oxanium": "^0.2.2",
    "@fortawesome/fontawesome-svg-core": "^6.1.1",
    "@fortawesome/free-solid-svg-icons": "^6.1.1",
    "@fortawesome/react-native-fontawesome": "^0.3.0",
    "@react-navigation/drawer": "^6.4.3",
    "@react-navigation/native": "^6.0.11",
    "@react-navigation/native-stack": "^6.7.0",
    "axios": "^0.27.2",
    "expo": "^46.0.0",
    "expo-status-bar": "~1.4.0",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.4",
    "react-native-dotenv": "^3.3.1",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-svg": "12.3.0",
    "react-native-web": "~0.18.7",
    "react-native-webview": "11.23.0",
    "react-native-youtube-iframe": "^2.2.2"
  },
  "devDependencies": {
    "@babel/core": "^7.18.6",
    "@babel/preset-react": "^7.18.6",
    "eslint": "^8.19.0",
    "eslint-plugin-react": "^7.30.1",
    "eslint-plugin-react-native": "^4.0.0"
  },
  "private": true
}

babel.config.js

module.exports = function(api) {
  api.cache(true);
  return {
    presets: [
      'babel-preset-expo'
    ],
    plugins: [
      'react-native-reanimated/plugin',
      'module:react-native-dotenv'
    ]
  };
};

Solution

Found the solution. You have to run the emulator without Android Studio (ie. from the command line)

In Windows:

cd C:\Users\%USERNAME%\AppData\Local\Android\Sdk\emulator
emulator -avd Pixel_5_API_30

Of course, switch ‘Pixel_5_API_30’ with the name of the emulator listed in Android Studio.

enter image description here

Answered By – Jat90

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published