Migration to Cypress 10 fails when converting cypress.json with the error "SyntaxError: Unexpected token ="
See original GitHub issueCurrent 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 details13 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:
- Created a year ago
- Comments:8
Top GitHub Comments
@rockindahizzy … sorry, should have done that originally. This is the contents of the cypress.json file:
@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.