Reproduction for Cypress issue #22825
- Run
npx cypress open --port 4001 --component --browser electron
- Execute
MyComponent.spec.js
, observefetch
failure is reported in command log (expected) but no meaningful error is logged to terminal - Open devtools console, click failed
fetch
entry in command log. Observe error that is printed:TypeError: Cannot read properties of null (reading 'token')
- this is an internal Cypress error that should not have occurred
- From PR branch run
yarn dev --project {PROJECT_DIRECTORY} --port 4001 --component --browser electron
- Execute
MyComponent.spec.js
, observefetch
failure is reported in command log (expected) and no stacktrace is logged to terminal - Open devtools console, click failed
fetch
entry in command log. Observe error that is printed reflects "real" error that occurred on this request:ECONNREFUSED 127.0.0.1:80
-
From PR branch, edit
server-base.ts
. Modify this block:const getFileServerToken = () => { return this._fileServer?.token }
to this (add unsafe access of
token
)const getFileServerToken = () => { return this._fileServer!.token }
This re-introduces an internal error that can occur in v12.5.1 that is fixed by this PR
-
Run
yarn dev --project {PROJECT_DIRECTORY} --port 4001 --component --browser electron
-
Execute
MyComponent.spec.js
, observefetch
failure is reported in command log (expected), observe stack trace is output to terminal