Unexpected token, expected ";"
See original GitHub issueI’m trying to use this plugin with React Native but am stuck with this error:
Node version: 8.10 Plugin version: 2.6.2
My files are as such: .babelrc
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": ["react-native-paper/babel", "import-graphql"]
}
all-cattles.query.graphql
query allCattles {
listCattle {
name
}
}
Please let me know if there’s anything else needed. Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
reactjs - React - unexpected token, expected ; - Stack Overflow
The reason your component is experiencing this error is because of the following: 1. If you define a function outside of an ES6...
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 ':'. Expected a ')' or a ',' after a ...
Current and expected behavior App shows red box with the error: SyntaxError: Unexpected token ':'. Expected a ')' or a ',' after a...
Read more >Unexpected token, expected "," : r/reactjs - Reddit
Hey guys, I'm loading some data coming from an API and now I want to add some conditions, as you can see below...
Read more >unexpected token, expected "," jest - You.com | The AI Search ...
It appears to me that there is an issue in the package you're using. It's trying to use ES modules syntax (import /...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was seeing this, but incorrectly included
graphql
in mysourceExts
instead ofassetExts
in my metro config as described here in https://github.com/detrohutt/babel-plugin-import-graphql/issues/50.This worked for me:
I’m closing this for now since it’s been open for almost 7 months and only has one +1. If the solution @jefflewis mentioned doesn’t work for someone, and you get this same error, let me know and I’ll reopen the issue.