-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests sometimes failing with a JSON.parse error #27555
Comments
experiencing same issue. Error log: |
It also happens in 12.16.0. Downgrading to 12.1.0 appears to have fixed the issue. I hope to be able to debug which version is causing this in about 2 weeks, since I'm not developing tests next week. |
I've tried different versions today.
It appears that a regression has occurred in 12.15.0. Looking at the release notes for that version, I'd suspect that this is the cause:
I'll downgrade to 12.14.0 for now, and I hope someone else finds the time to debug the issue and fix it. |
It also happened to us :( Downgrading didn't help, unfortunately. Considering disabling cypress cloud dashboard parallelization now, because usually when re running a failed action, it works. So we are considering a possibility with some issues on the cypress cloud side. After disabling cypress cloud, the tests are passing consistently. |
This issue doesn't happen anymore in 13.2.0 for me, so it might have gotten fixed somewhere inbetween. |
@scopsy Could you upgrade to 13.2.0 and see if it still happens for you? |
What helped me with this issue was double checking the GitHub actions secret. After editing mine to the correct format, I was able to get it running with no issues. |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
Current behavior
When I run my Cypress tests in Chrome headed, there is no issue, either via cypress open or cypress run --headed. However, when I try to run them headlessly, sometimes they fail with a JSON parse error. The position in the JSON parse error can change with the error. I'm on Windows 10. It could happen at any time during test execution (my test lasts 2-3 minutes). I used yarn upgrade to upgrade my dependencies, but it's still happening. The application I'm testing is very old (e.g. uses iframes inside of frames). I think there might be a communication issue with the headless browser. I installed Ubuntu as a VM on this machine and ran the same tests, and the issue occurred there as well. I have no clue where to start debugging. How would I even debug this?
`
DevTools listening on ws://127.0.0.1:61099/devtools/browser/f1c85310-d86a-4c6f-84c2-bd6586fbce7a
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 12.17.3 │
│ Browser: Chrome 115 (headless) │
│ Node Version: v20.5.0 (C:\Program Files\nodejs\node.exe) │
│ Specs: 1 found (initial-setup.cy.ts) │
│ Searched: C:\dev**\cypress\e2e\initial-setup.cy.ts │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: initial-setup.cy.ts (1 of 1)
Setup system from empty database
√ should allow creating a new user role (40816ms)
Expected ',' or '}' after property value in JSON at position 11572
SyntaxError: Expected ',' or '}' after property value in JSON at position 11572
at JSON.parse ()
at A. (:2385:521659)
at A.emit (node:events:527:28)
at g.U (:2385:506953)
at g.emit (node:events:527:28)
at g.dataMessage (:2385:487328)
at :2385:486860
at :2385:478182
at :2385:479134
at afterWrite (node:internal/streams/writable:497:5)
at onwrite (node:internal/streams/writable:477:7)
at Zlib.cb (node:internal/streams/transform:202:7)
at Zlib.processCallback (node:zlib:611:8)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
`
Desired behavior
Continue the test and not throw the JSON parse error
Test code to reproduce
I can't provide this.
Cypress package version: 12.17.3
Cypress binary version: 12.17.3
Electron version: 21.0.0
Bundled Node version:
16.16.0
Cypress Version
12.17.3
Node version
16.16.0
Operating System
Windows 10
Debug Logs
I can't provide all logs, due to this being an internal application. Is there any way to censor the logs? Are the logs needed to start debugging?
Other
I'm more than happy to help debug this issue, I just have no clue where to start.
The text was updated successfully, but these errors were encountered: