Skip to content
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

Possible regression in Cypress 9.1: TypeError: data.hasOwnProperty is not a function #19091

Closed
geoffharcourt opened this issue Nov 24, 2021 · 11 comments · Fixed by #19239
Closed

Comments

@geoffharcourt
Copy link

Current behavior

We're running a series of tests against our production application using Cypress. The runner is using the cypress/browsers:node16.5.0-chrome94-ff93 Docker image. All of our tests fail with a similar stacktrace and none of the lines include our own test code. This suite runs successfully in Cypress 9.0.

Here's the failure we get on almost all of the specs in our suite:

TypeError: data.hasOwnProperty is not a function
--
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:39:22)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:32:26)
  | at Object.deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:16:17)
  | at Encoder.encodeAsBinary (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:80:41)
  | at Encoder.encode (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:42:29)
  | at Client._packet (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/client.js:169:44)
  | at Socket.packet (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:160:21)
  | at /root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:274:18
  | at /root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/lib/socket-base.js:318:28
  | at tryCatcher (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
  | at Promise._settlePromiseFromHandler (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
  | at Promise._settlePromise (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
  | at Promise._settlePromise0 (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
  | at Promise._settlePromises (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
  | at _drainQueueStep (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
  | at _drainQueue (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
  | at Async._drainQueues (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
  | at Immediate.Async.drainQueues [as _onImmediate] (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
  | at processImmediate (node:internal/timers:464:21)
  |  
  | TypeError: data.hasOwnProperty is not a function
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:39:22)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
  | at _deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:32:26)
  | at Object.deconstructPacket (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:16:17)
  | at Encoder.encodeAsBinary (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:80:41)
  | at Encoder.encode (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:42:29)
  | at Client._packet (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/client.js:169:44)
  | at Socket.packet (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:160:21)
  | at /root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:274:18
  | at /root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/lib/socket-base.js:318:28
  | at tryCatcher (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
  | at Promise._settlePromiseFromHandler (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
  | at Promise._settlePromise (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
  | at Promise._settlePromise0 (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
  | at Promise._settlePromises (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
  | at _drainQueueStep (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
  | at _drainQueue (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
  | at Async._drainQueues (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
  | at Immediate.Async.drainQueues [as _onImmediate] (/root/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
  | at processImmediate (node:internal/timers:464:21)
  |  
  | [502:1124/150621.083113:ERROR:bus.cc(392)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
  | [502:1124/150621.084970:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
  | [502:1124/150621.085005:ERROR:bus.cc(392)] Failed to connect to the bus: Address does not contain a colon
  | [666:1124/150621.113215:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is

Desired behavior

We're just looking to figure out what changed from 9.0 -> 9.1 to cause this issue. We're able to run these tests locally, but they fail in

Test code to reproduce

  it('Home page - shows expected content', () => {
    cy.visit('/');

    cy.contains('Making millions of students better readers and writers');
  });

Our base URL is www.commonlit.org.

Cypress Version

9.1.0

Other

No response

@geoffharcourt geoffharcourt changed the title Possible regression in Cypress 9.1 Possible regression in Cypress 9.1: TypeError: data.hasOwnProperty is not a function Nov 24, 2021
@cexbrayat
Copy link
Contributor

cexbrayat commented Nov 25, 2021

We do also hit this issue in v9.1. After investigation, it only appears in our projects that use @percy/cypress. Is that the case for you @geoffharcourt ?

See percy/percy-cypress#434 for the percy/cypress issue

@geoffharcourt
Copy link
Author

@cexbrayat we so as well! Thanks for the info, this is quite helpful.

@weyert
Copy link

weyert commented Nov 26, 2021

Yes, I am having the same issue but not using @percy/cypress:

❯ npm ls @percy/cypress
system-tests@0.11.0 /Users/Developer/Development/Projects/xxx/system-tests
└── (empty)

@Robdel12
Copy link

Seems like it's a regression in Cypress networking. Smells a lot like #15101 🤨

@DamienCassou
Copy link

We face the issue but don't use percy-cypress.

@JelleEVI
Copy link

Same issue, also using Percy. Can actually open and run tests using the debugger (cypress open), but running from terminal fails with given error. Downgrade to Cypress 9.0.0 solves the issue for me.

@Robdel12
Copy link

Robdel12 commented Dec 2, 2021

I spent some time digging in to try and isolate & reproduce.

describe("Breaking reproduction", function () {
  it("doesn't throw an error when making requests", function () {
    cy.then(() =>
      Cypress.backend("http:request", {
        url: "http:localhost:8001/nothing/here",
        method: "POST",
      })
    );
  });
});

This will break with the same stack trace in the OP.

@DamienCassou
Copy link

@Robdel12 what is Cypress.backend()?

@peterpme
Copy link

peterpme commented Dec 3, 2021

We have the same issue, but we don't use Percy.

TypeError: data.hasOwnProperty is not a function
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:39:22)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
    at _deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:32:26)
    at Object.deconstructPacket (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:16:17)
    at Encoder.encodeAsBinary (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:80:41)
    at Encoder.encode (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/index.js:42:29)
    at Client._packet (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/client.js:169:44)
    at Socket.packet (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:160:21)
    at /home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/socket/node_modules/socket.io/dist/socket.js:274:18
    at /home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/lib/socket-base.js:318:28
    at tryCatcher (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/circleci/.cache/Cypress/9.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:464:21)

@cypress-bot cypress-bot bot added the stage: needs review The PR code is done & tested, needs review label Dec 3, 2021
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Dec 3, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 3, 2021

The code for this is done in cypress-io/cypress#19239, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 4, 2021

Released in 9.1.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v9.1.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Dec 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants