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 function" when running Backstop

See original GitHub issue

I want to give BackstopJS a try, but I’m not getting very far. Both backstop init and the sanity test return the error “SyntaxError: Unexpected token function”.

C:\temp\backstopSanityTest>node node_modules/backstopjs/cli/index.js test --config=node_modules/backstopjs/test/configs/backstop
C:\temp\backstopSanityTest\node_modules\backstopjs\core\util\runPuppet.js:38
async function processScenarioView (scenario, variantOrScenarioLabelSafe, scenarioLabelSafe, viewport, config, runId) {
      ^^^^^^^^
SyntaxError: Unexpected token function
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\temp\backstopSanityTest\node_modules\backstopjs\core\util\createBitmaps.js:10:17)
    at Module._compile (module.js:570:32)

I’ve tried with both a globally installed BackstopJS (npm install -g backstopjs) and locally as suggested for the sanity test. I’ve also installed Python 3.6.5 and that is in the Path.

I am running Windows 10 without admin rights.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
pbb72commented, Apr 13, 2018

My fault, I was using an outdated Node. Updated Node, and everything seems to be running smooth now 😃

1reaction
mariovalneycommented, May 15, 2018

It’s happening here too [BackstopJS 3.2.16].

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected token function - Async Await Nodejs
You'll need to transpile your code (e.g. using Babel) to a version of JS that Node understands if you are using an older...
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 >
[NODE-1908] async function* asyncIterator() { - SyntaxError
Hi, since the update to 3.2.1, I get this error when I try to start node and it seems related to this code...
Read more >
Diff - b8a8cc1^! - platform/external/v8
During this + uninitialized state, code event handlers and function entry ... + + Run JS micro tasks in the appropriate context (Chromium...
Read more >
The OCaml system release 4.03
11.4 Running executables produced by ocamlopt . ... 22.13 Module Hashtbl : Hash tables and hash functions.
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