Skip to content

TypeError: Cannot read property '_cookieJar' of null #8613

Closed
@bravelincy

Description

@bravelincy

🐛 Bug Report

Connect to a socket.io cause an this error:

(node:66998) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '_cookieJar' of null
    at resolve (/Users/xxx/node_modules/jsdom/lib/jsdom/living/websockets/WebSoc
ket-impl.js:124:39)

To Reproduce

test('connection', async () => {
  const port = await getPort({ port: getPort.makeRange(8080, 65535) })
  const io = socketIO(port)
  const connection = new Promise(resolve => {
    io.on('connection', resolve)
  })
  const client = socket('http://localhost:' + port)
  await connection
})

Expected behavior

no errors log

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions