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.

Unhandled JS Exception: Unexpected token '{'. import call expects exactly one argument. no stack

See original GitHub issue

Everything’s work fine until I build my project on Xcode to see my app on real device…

Everything is build fine with no errors, yarn start and Xcode Play button (for build)

Capture d’écran 2019-03-21 à 23 06 17
$ react-native info
info 
  React Native Environment Info:
    System:
      OS: macOS 10.14.1
      CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
      Memory: 170.70 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 11.10.0 - /usr/local/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
    IDEs:
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: 0.59.0 => 0.59.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:10
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
jeffreyhaencommented, Jun 13, 2019

I’m having the same issue after upgrading to RN 0.59.9. The error message gives basically no clue what’s wrong…

5reactions
unmeccommented, Sep 11, 2019

UPDATE

OK here is the digest of a few good hours spent:

In your index.js, there is something like this:

import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);

Which import the name from app.json

{
  "name": "yourAppName",
  "displayName": "yourAppName"
}

To get rid of this error, just change index.js to:

AppRegistry.registerComponent('yourAppName', () => App);

and stop importing that json file.

You can keep all your present settings in devDependencies

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expo problem. Unexpected token '{'. Import call expects ...
Unexpected token '{'. Import call expects exactly one argument - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing ...
Read more >
How to fix the error "unexpected token "{". import call expects ...
Here is how to fix the error SyntaxError: Unexpected token '{'. import call expects exactly one argument.
Read more >
Unexpected identifier '_classCallCheck'. import call expects ...
Unhandled JS Exception : Unexpected identifier '_classCallCheck'. import call expects exactly one argument. no stack. 在这里插入图片描述 ...
Read more >
the attached codes doesnt work - React Native
“Unhandled JS Exception: Unexpected identifier '_classCallCheck'. import call expects exactly one argument. no stack”.
Read more >
Unexpected token '{'. import call expects exactly one argument ...
Javascript Required. Kindly enable Javascript. · Unhandled JS Exception: Unexpected token '{'. import call expects exactly one argument. no stack.
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