`SyntaxError: Unexpected token` when encountering React Fragment shorthand syntax
See original GitHub issueSyntaxError: Unexpected token (112:13)
at Parser.pp$5.raise (./node_modules/babylon/lib/index.js:4454:13)
at Parser.pp.unexpected (./node_modules/babylon/lib/index.js:1761:8)
at Parser.pp$9.jsxParseIdentifier (./node_modules/babylon/lib/index.js:7029:10)
at Parser.pp$9.jsxParseNamespacedName (./node_modules/babylon/lib/index.js:7040:19)
at Parser.pp$9.jsxParseElementName (./node_modules/babylon/lib/index.js:7055:19)
at Parser.pp$9.jsxParseOpeningElementAt (./node_modules/babylon/lib/index.js:7145:20)
at Parser.pp$9.jsxParseElementAt (./node_modules/babylon/lib/index.js:7169:29)
at Parser.pp$9.jsxParseElement (./node_modules/babylon/lib/index.js:7224:15)
at Parser.parseExprAtom (./node_modules/babylon/lib/index.js:7236:21)
at Parser.pp$3.parseExprSubscripts (./node_modules/babylon/lib/index.js:3494:19)
when it encounters Babel 7’s shorthand of React.Fragment, <>.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Fragments giving Unexpected token error in React 16.2
1 Answer 1 · @shubham Khatri You are life saver. – Nimmi Verma · 2. Exactly you right, new XML / JSX syntax...
Read more >Compile error: I can't use "<>" and "</>" anymore? : r/reactjs
Syntax error : Unexpected token (95:21) ...which points to the first ... For reference I searched: "react fragment shorthand error". Upvote
Read more >`SyntaxError: Unexpected token` when encountering React ...
SyntaxError : Unexpected token` when encountering React Fragment shorthand syntax.
Read more >react unexpected token fragment
Bug Report Test suite failed to run Jest encountered an unexpected token This usually means that you are trying to import a file...
Read more >Fragments giving Unexpected token error in React 16.2-Reactjs
As per the documentation, the syntax <></> is not supported by all tools and they encourage you to use <React.Fragment> instead.
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 Free
Top 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

(possibly duplicate of #79 )
I updated the underlying parser, lets see if this is still an issue @luckykun