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

Error during debug on iOS: WebSocket is not open: readyState 2 (CLOSING) #4291

Closed
rosen-vladimirov opened this issue Jan 16, 2019 · 0 comments
Assignees
Labels
bug no-changelog The issue is present only in `next` versions and was not included in official version.
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Jan 16, 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.1-2019-01-11-12787
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: 5.1.0
  • Plugin(s): Not applicable

Describe the bug
During debug on iOS, in case you open Chrome DevTools and close them before they've rendered the sources (i.e. while the communication between iOS Runtime and Chrome DevTools is in progress), CLI crashes with error:

WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (C:\Work\nativescript-cli\node_modules\ws\lib\websocket.js:314:19)
    at PacketStream.packets.on (C:\Work\nativescript-cli\lib\device-sockets\ios\app-debug-socket-proxy-factory.js:132:31)
    at emitOne (events.js:116:13)
    at PacketStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at PacketStream.Readable.push (_stream_readable.js:208:10)
    at PacketStream.Transform.push (_stream_transform.js:147:32)
    at PacketStream._transform (C:\Work\nativescript-cli\lib\device-sockets\ios\packet-stream.js:30:22)
    at PacketStream.Transform._read (_stream_transform.js:186:10)
    at PacketStream.Transform._write (_stream_transform.js:174:12)
    at doWrite (_stream_writable.js:397:12)
    at writeOrBuffer (_stream_writable.js:383:5)
    at PacketStream.Writable.write (_stream_writable.js:290:11)
    at Socket.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at TCP.onread (net.js:597:20)

To Reproduce

  1. On any project run: tns debug ios (better use device). It could be even easier to reproduce with tns debug ios --bundle
  2. When CLI prints the Chrome DevTools URL, open it.
  3. After several seconds, but BEFORE seeing any file in the Chrome DevTools, close the browser tab.

NOTE: Issue is not reproducible every time.

Expected behavior
CLI to allow you to attach again later.

@rosen-vladimirov rosen-vladimirov added this to the 5.1.1 milestone Jan 16, 2019
@rosen-vladimirov rosen-vladimirov self-assigned this Jan 16, 2019
@rosen-vladimirov rosen-vladimirov added no-changelog The issue is present only in `next` versions and was not included in official version. ready for test labels Jan 16, 2019
@miroslavaivanova miroslavaivanova self-assigned this Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug no-changelog The issue is present only in `next` versions and was not included in official version.
Projects
None yet
Development

No branches or pull requests

2 participants