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.

SyntaxError: Unexpected token

See original GitHub issue

error code ↓↓↓↓

image

` ERROR in …/pc-react-next/src/index.js Module build failed: SyntaxError: /Users/tezml/Desktop/pc-react-next/src/index.js: Unexpected token (362:9)

  360 | 		let {levels=[], names={}} = level1 
  361 | 
> 362 | 		return <div className={divider ? "cndzk-entrance-divider" : 'cndzk-entrance'} style={style}>`

import ↓↓↓↓

image image image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ChrisCoppola-Avlinocommented, Mar 23, 2020

Hey @nicolo-ribaudo just want to point out that, this was a false alarm in my case.

Ended up being a bug in my build process. My .tsconfig file had emitDeclarationOnly removed from it, and was supposed to have --emitDeclarationOnly flag added to the npm script, but somehow had neither. I was running typescript compiler after webpack to generate d.ts files for a library, causing it to overwrite my index.js (the webpack bundle), and use non-bundled jsx code.

So, completely unrelated to babel 💃 . Sorry I won’t be able to help any further! Was just a coincidence it happened in the same commit/pull-request.

2reactions
ChrisCoppola-Avlinocommented, Mar 20, 2020

@nicolo-ribaudo I don’t have time at the moment, but I will attempt to in the next few days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
syntax error: unexpected token - javascript - Stack Overflow
The error SyntaxError: Unexpected token < likely means the API endpoint didn't return JSON in its document body, such as due to a...
Read more >
Have a JavaScript Unexpected Token Error? Check Your Syntax
Today, we are discussing the Unexpected Token Error within our JavaScript Error Handling series. This JavaScript error is a subset of the ...
Read more >
JavaScript SyntaxError - Unexpected token - GeeksforGeeks
This JavaScript exceptions unexpected token occur if a specific language construct was expected, but anything else is typed mistakenly.
Read more >
Nodejs Uncaught SyntaxError: Unexpected token import
Unexpected token error occurs most commonly because the code used for a page referred to the property you have not used anymore or...
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