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.

Migration to Cypress 10 fails when converting cypress.json with the error "SyntaxError: Unexpected token ="

See original GitHub issue

Current behavior

I had Cypress 9.7.0 installed. I ran npm install -D cypress@latest which installed Cypress 10.3.1 with the following output:

C:\dev\myProject>npm install -D cypress@latest

changed 1 package, and audited 1018 packages in 2m

60 packages are looking for funding run npm fund for details

13 vulnerabilities (9 moderate, 3 high, 1 critical)

To address issues that do not require attention, run: npm audit fix

Some issues need review, and may require choosing a different dependency.

Run npm audit for details.

I then ran npx cypress open to launch the new Cypress and the migration wizard. This was the output:

C:\dev\myProject>npx cypress open

It looks like this is your first time using Cypress: 10.3.1

√ Verified Cypress! C:\Users\kodriscoll\AppData\Local\Cypress\Cache\10.3.1\Cypress

Opening Cypress…

The migration wizard appeared and prompted me to migrate my cypress.json file. When I clicked on the “Migrate for me” button, I got the following output and the “cy” spinner is still running after 20 minutes:

[4008:0801/102904.039:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id [4008:0801/102904.230:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id [4008:0801/102915.751:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id [4008:0801/103126.107:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id [4008:0801/103338.724:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id [4008:0801/103556.597:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id C:\Users\kodriscoll\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules@packages\server\lib\plugins\child\run_plugins.js:40 invoke = (eventId, args = []) => { ^

SyntaxError: Unexpected token = at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (C:\Users\kodriscoll\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules@packages\server\lib\plugins\child\run_require_async_child.js:6:24) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (C:\Users\kodriscoll\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules@packages\server\lib\plugins\child\require_async_child.js:12:13) [4008:0801/103904.361:ERROR:display_layout.cc(559)] PlacementList must be sorted by first 8 bits of display_id

Desired behavior

For the migration to finish successfully.

Test code to reproduce

This is an upgrade using the Cypress migration wizard. Not really any test code to show.

Cypress Version

10.3.1

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
kodriscollicscommented, Aug 3, 2022

@rockindahizzy … sorry, should have done that originally. This is the contents of the cypress.json file:

{
  "integrationFolder": "C:/dev/myProject/cypress/tests",
  "projectId": "My Project UI Automation Testing",
  "baseUrl": "https://test.myOrg.org",
  "chromeWebSecurity": false,
  "viewportWidth": 1600,
  "viewportHeight": 1200,
  "watchForFileChanges": false,
  "screenshotOnRunFailure": true,
  "videoCompression": 32,
  "video": false,
  "nodeVersion": "bundled",
  "retries": {
    "runMode": 0,
    "openMode": 0
  },
  "codeCoverage": {
  },
  "env": {
    "User1": {
      "password": "password",
      "username": "username",
      "fullName": "fullname",
      "compoundName": "username (username)"
    },
    "apiEndPoint": {
      "apiEndPointUrl": "https://test.myOrg.org/apiEndpoint",
      "apiEndPointUsername": "apiUsername",
      "apiEndPointCred": "boguscreddoweiujwe8sojsdlfkjweoijsdfkjowiefslkdjfssdfsdfjl=",
      "apiEndPointAuth": "Basic boguscreddoweiujwe8sojsdlfkjweoijsdfkjowiefslkdjfssdfsdfjl="
    },
    "TestData": {
      "SearchOpt": "building",
      "searchString": "2919854",
      "Location": "United States"
    }
  }
}
0reactions
kodriscollicscommented, Aug 15, 2022

@rockindahizzy I found the cause for the install issue. My package.json file had a dependencies section that looks like this:

“dependencies”: { “dayjs”: “^1.10.7”, “mocha”: “^9.1.3”, “node”: “^10.24.1” }

When I removed the “node”: “^10.24.1” line from the file, the upgrade worked properly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress 10 throws error readying js config file: SyntaxError
I'm trying to update transition our CI e2e runs to run Cypress 10.x. It runs on a Docker container via BuildKite and it's...
Read more >
Migration Guide
Migrating to Cypress 12.0 This guide details the changes and how to change your code to migrate to Cypress version 12.0.
Read more >
Troubleshoot 'Uncaught SyntaxError: Unexpected token u in ...
An unexpected token simply means that it was expecting data, but instead got a command keyword (but this error can be triggered by...
Read more >
How To Fix Unexpected token u in JSON at position 0
This error is caused when you are attempting to parse a non-existent property. Typically, this is due to a misspelling, or simply referencing ......
Read more >
SyntaxError: missing ) after argument list - JavaScript | MDN
There is an error with how a function is called. This might be a typo, a missing operator, or an unescaped string, for...
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