Debugging rejections from session API exposed by Spectron


#1

I’ve been digging into testing an Electron app. In order to test the app, I need to access webRequest to setup listeners on HTTP requests. This lives in the session(defaultSession) API. However, in Spectron, session.defaultSession is a function that returns a promise, compared to the documentation listed here which defines it as a property.

This is well and good, but I’ve been getting promise rejections from session.defaultSession and I’m not sure how to debug. Any tips?

Error:
{ Error: An unknown server-side error occurred while processing the command. at execute(<Function>, "session", "defaultSession", , "require") - api.js:269:21 message: 'unknown error: unhandled inspector error: {"code":-32000,"message":"Object has too long reference chain"}', type: 'RuntimeError', seleniumStack: { status: 13, type: 'UnknownError', message: 'An unknown server-side error occurred while processing the command.', orgStatusMessage: 'unknown error: unhandled inspector error: {"code":-32000,"message":"Object has too long reference chain"}\n (Session info: content shell=)\n (Driver info: chromedriver=2.27 (44a803957cb27610c38f7e859016ac257959aeb5),platform=Linux 4.12.0-2-amd64 x86_64)' } }