Description
Current behavior
I have simple test which works on Cypress 14.0.3 and fails on Cypress 14.1.0 and 14.5.0 (I haven't tried all the other versions).
SyntaxError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
> JSON.parse: unexpected character at line 1 column 1 of the JSON data
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
Although it says the error originated from my application, the code has not change. I was only tried to upgrade Cypress.
Desired behavior
The test should pass as it did before, since the code has not changed.
Test code to reproduce
I'm using Laravel and Livewire and I was able to reproduce the issue with the following steps:
- create a brand new Laravel application
laravel new --livewire --pest --npm example-app
- change into the new project's directory
cd example-app
- install Cypress
npm install cypress --save-dev
- create the configuration file
npx cypress open --e2e
- add the base URL to
cypress.config.js
baseUrl: "http://localhost:8000"
- create a user for the test
php artisan tinker --execute="App\Models\User::factory()->create(['email' => 'test@example.com']);"
- create the directory for the Cypress tests
mkdir cypress/e2e
- create the Cypress test
cypress/e2e/login.cy.js
it('should sing a user in', () => {
cy.visit('/login')
cy.get('[type="email"]').type('test@example.com')
cy.get('[type="password"]').type('password')
cy.get('[type="submit"]').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/dashboard')
})
})
- in another terminal, run a PHP server
cd example-app
composer dev
- finally, run Cypress
npx cypress run --browser firefox
Cypress Version
14.5.0
Node version
v22.16.10
Operating System
Mac Sequoia Version 15.5 (24F74)
Debug Logs
Other
This happens with Firefox 139. It works fine with Chrome 137, Edge 137, and Electron 130
I've tried to get the debug log with DEBUG=cypress:* npx cypress run --browser firefox
but the log is too big to paste into the issue (Field can not be longer than 65536 characters). I know I can target the log, but I don't know what would be useful. Please let me know if you some specific logs.