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.

Unexpected token ERROR

See original GitHub issue

I have been trying to figure this out for months…

I have uninstalled and reinstalled the package numerous times, tried changing settings, etc.

I am using Node v8.9 so the spread operator should be allowed.

I am only using a local version of eslint@5.8.0 installed in node_modules

SublimeLinter: #1 eslint Terrain.js ERROR:
==========================================

.../node_modules/eslint/lib/linter.js:288
                disableDirectives.push(...createDisableDirectives(directiveType, comment.loc.start, directiveValue));
                                       ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (.../node_modules/eslint/lib/cli-engine.js:21:14)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
rchlcommented, Nov 2, 2018

If it throws syntax error on spread operator then it must be using older version of node. Maybe run this in Sublime’s console and see what it outputs:

import subprocess
print(subprocess.check_output(['node', '--version']))
1reaction
dijscommented, Nov 2, 2018

Oh wow. I just had the idea of downgrading eslint to “4.19.1”

That actually worked!

Soo… SublimeLinter doesn’t like something in v5 of eslint

Read more comments on GitHub >

github_iconTop Results From Across the Web

Have a JavaScript Unexpected Token Error? Check Your Syntax
The JavaScript's parser expects tokens and symbols in a particular order, with relevant values or variables in between. Often, an Unexpected ...
Read more >
JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >
How to fix: "SyntaxError: Unexpected token" in JavaScript
One common cause of the SyntaxError: Unexpected token error is a missing semicolon. In JavaScript, semicolons are used to indicate the end of...
Read more >
How to fix JavaScript unexpected token error
As you write your JavaScript application, the unexpected token error always occurs because JavaScript expected a specific syntax that's not ...
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 >

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