react-native: Unhandled JS Exception: Unexpected token '{'. import call expects exactly one argument. no stack
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)
$ 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
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 9
- Comments: 15 (3 by maintainers)
I’m having the same issue after upgrading to RN 0.59.9. The error message gives basically no clue what’s wrong…
UPDATE
OK here is the digest of a few good hours spent:
In your
index.js, there is something like this:Which import the name from app.json
To get rid of this error, just change
index.jsto:and stop importing that json file.
You can keep all your present settings in
devDependenciesHey @steffi3rd, I suspect that there’s actually an issue in your project’s code. I think if you look at Metro, you’ll see a build-time error.
A few tips:
Without a repository of your source, it’s hard to give specific advice. This seems like an environment issue, but please do follow up with more detail if my pointers above don’t help.