-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
Description
Describe the bug
Node.js version: 20.10.0
OS version: debian trixie/sid
Description: Including supertest in a cypress project results in the error Object prototype may only be an Object or null: undefined
when supertest tries to include superagent.
Actual behavior
Creating a blank cypress project and including supertest as a requirement in any spec file generates the error
Object prototype may only be an Object or null: undefined
With the backtrace:
at Function.setPrototypeOf (<anonymous>)
at ./node_modules/supertest/lib/agent.js (webpack://cypress-supertest-issue-minimal/./node_modules/supertest/lib/agent.js:36:0)
at __webpack_require__ (webpack://cypress-supertest-issue-minimal/webpack/bootstrap:19:0)
at ./node_modules/supertest/index.js (webpack://cypress-supertest-issue-minimal/./node_modules/supertest/index.js:9:14)
at __webpack_require__ (webpack://cypress-supertest-issue-minimal/webpack/bootstrap:19:0)
at eval (webpack://cypress-supertest-issue-minimal/./cypress/e2e/spec.cy.js:1:18)
Expected behavior
It should be possible to require (and use) the library without issue, as was the case until version 6.2.4.
Code to reproduce
I created an example project with a minimal reproduction here: https://github.com/codders/cypress-supertest-issue-minimal
Checklist
- I have searched through GitHub issues for similar issues.
- I have completely read through the README and documentation.
- I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.