filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
264 stars 35 forks source link

TypeError - Cannot read properties of undefined (reading 'value') for API response Status:204 (No Content) #115

Closed mluk-sastrify closed 1 year ago

mluk-sastrify commented 1 year ago

Cypress package version: 12.4.1 Chrome version: 110.0 cypress-plugin-api: 2.10.3

For the PATCH method with response Status:204 (No Content) there's an error: image

Cannot read properties of undefined (reading 'value')

index-8be105ad.js:101729 TypeError: Cannot read properties of undefined (reading 'value')

    at Fe (webpack:///./node_modules/cypress-plugin-api/dist/support.js:12:1969)
    at Context.eval (webpack:///./node_modules/cypress-plugin-api/dist/support.js:14:2091)
From previous event:
    at Context.thenFn (http://localhost:7777/__cypress/runner/cypress_runner.js:135668:63)
    at Context.then (http://localhost:7777/__cypress/runner/cypress_runner.js:135917:21)
    at wrapped (http://localhost:7777/__cypress/runner/cypress_runner.js:151098:19)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:149957:15)
From previous event:
    at CommandQueue.runCommand (http://localhost:7777/__cypress/runner/cypress_runner.js:149923:8)
    at next (http://localhost:7777/__cypress/runner/cypress_runner.js:150123:19)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:150144:16)
From previous event:
    at next (http://localhost:7777/__cypress/runner/cypress_runner.js:150123:39)
From previous event:
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:163626:77)
From previous event:
    at CommandQueue.run (http://localhost:7777/__cypress/runner/cypress_runner.js:163621:21)
    at CommandQueue.run (http://localhost:7777/__cypress/runner/cypress_runner.js:150187:15)
    at $Cy.runQueue (http://localhost:7777/__cypress/runner/cypress_runner.js:151078:14)
    at cy.<computed> [as api] (http://localhost:7777/__cypress/runner/cypress_runner.js:151160:12)
    at runnable.fn (http://localhost:7777/__cypress/runner/cypress_runner.js:151339:19)
    at callFn (http://localhost:7777/__cypress/runner/cypress_runner.js:104935:21)
    at ../driver/node_modules/mocha/lib/runnable.js.Runnable.run (http://localhost:7777/__cypress/runner/cypress_runner.js:104922:7)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:158288:30)
From previous event:
    at onNext (http://localhost:7777/__cypress/runner/cypress_runner.js:158206:59)
    at done (http://localhost:7777/__cypress/runner/cypress_runner.js:104875:5)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:104940:11)
From previous event:
    at callFn (http://localhost:7777/__cypress/runner/cypress_runner.js:104938:14)
    at ../driver/node_modules/mocha/lib/runnable.js.Runnable.run (http://localhost:7777/__cypress/runner/cypress_runner.js:104922:7)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:158288:30)
From previous event:
    at Object.onRunnableRun (http://localhost:7777/__cypress/runner/cypress_runner.js:158271:53)
    at $Cypress.action (http://localhost:7777/__cypress/runner/cypress_runner.js:147586:28)
    at Runnable.run (http://localhost:7777/__cypress/runner/cypress_runner.js:156289:13)
    at next (http://localhost:7777/__cypress/runner/cypress_runner.js:105437:10)
    at <unknown> (http://localhost:7777/__cypress/runner/cypress_runner.js:105481:5)
    at timeslice (http://localhost:7777/__cypress/runner/cypress_runner.js:99407:27)
wlsf82 commented 1 year ago

I've also been facing this issue, which even made me remove the plugin from an important project.

filiphric commented 1 year ago

I wasn’t able to replicate this, but I have a general idea of what could have caused the issue. fix is being released, feel free to repoen if it does not help. if not, it would help a lot if you provided some information about the request itself and response it is giving back. I believe it might be connected to how response size is parsed and handled