sockjs-node icon indicating copy to clipboard operation
sockjs-node copied to clipboard

getting hard to debug error in socksjs code while running cypress test

Open tnrich opened this issue 7 years ago • 4 comments

Hello there,

I'm hitting the following error while trying to run a cypress test.

image

I don't really understand why this error is being hit or why it has no real stack trace. Any insight you might have would be quite helpful. Here's the linked issue in the cypress repo: https://github.com/cypress-io/cypress/issues/2823

Thanks!

tnrich avatar Nov 30 '18 06:11 tnrich

And here is a screenshot of it being caught with no real stack trace.. image

It appears a newly named jsonp file gets created and called every time the test is run.

tnrich avatar Nov 30 '18 06:11 tnrich

This is the JSONP transport being used. For some reason, the function it is trying to use, does not exist. I would suggest checking your SockJS versions for both client and server.

brycekahle avatar Dec 10 '18 18:12 brycekahle

Here is what I could find about sockjs in my project:

Thomass-MacBook-Pro:openVectorEditorTgen tnrich$ yarn why sockjs
yarn why v1.10.1
[1/4] 🤔  Why do we have the module "sockjs"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "nwb#webpack-dev-server" depends on it
   - Hoisted from "nwb#webpack-dev-server#sockjs"
info Disk size without dependencies: "248KB"
info Disk size with unique dependencies: "456KB"
info Disk size with transitive dependencies: "708KB"
info Number of shared dependencies: 3
✨  Done in 1.34s.
Thomass-MacBook-Pro:openVectorEditorTgen tnrich$ yarn why sockjs-client
yarn why v1.10.1
[1/4] 🤔  Why do we have the module "sockjs-client"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "nwb#webpack-dev-server" depends on it
   - Hoisted from "nwb#webpack-dev-server#sockjs-client"
info Disk size without dependencies: "1.11MB"
info Disk size with unique dependencies: "1.56MB"
info Disk size with transitive dependencies: "1.88MB"
info Number of shared dependencies: 9
✨  Done in 0.84s.
Thomass-MacBook-Pro:openVectorEditorTgen tnrich$ yarn why sockjs-node
yarn why v1.10.1
[1/4] 🤔  Why do we have the module "sockjs-node"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
error We couldn't find a match!
✨  Done in 1.04s.

tnrich avatar Dec 11 '18 06:12 tnrich

@tnrich Is it possible your test runner is isolating sockjs somehow, such that it can't see those functions? I'm not familiar with Cypress.

brycekahle avatar Feb 14 '19 19:02 brycekahle