Vscode-arduino: COM port issue

Created on 20 Jun 2018  路  19Comments  路  Source: microsoft/vscode-arduino

I have issues with the COM port recently.
The COM port list does not show up when I click on the "Select Serial Port". I can set the COM port in the setting json and upload to Arduino board without issue. But if I try to open the port, the error message below show up.

Failed to open serial port COM4 due to error: + TypeError: Cannot read property 'close' of null

image
VScode and arduino extension are updated to latest version. The COM port is not in used

bug

Most helpful comment

I'm having the same error as @bluefate .
VSCode-Insiders version: 1.36.0

All 19 comments

@lamqhoang VSCode insider will repro on this issue, Can you use VSCode stable ?

VSCode insider has been upgraded to node.js >8.0 , This will have breaking changes on the native module on vscode arduino. we will fix this issue next.

This issue is resolved in the latest VSCode insider.

The Nodejs of VSCode insider is reverted to 7.9, so it work well now.

I believe this issue is present again in recent VSCode Insiders versions. Happens to me on 1.31.0-insider for Mac.

Snippet from Developer Tools:

TypeError: Cannot read property 'close' of null
    at Object.<anonymous> (bindings.js:27)
    at Object.<anonymous> (bindings.js:46)
    at Module.t._initNodeRequire.r._compile (loader.js:721)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722)
...

This exception is generated from the node-usb-native library.

Update

I just installed the standard VSCode (non-insiders) and both the serial port selection dialog and serial monitor are working there. It appears that it is only broken on VSCode Insiders.

@kjcolley7 this issue has been fixed with https://github.com/Microsoft/vscode-arduino/pull/731, and you can use Arduino extension in insiders with next release.

Getting the error in latest insiders version.
Failed to open serial port COM3 due to error: + TypeError: Cannot read property 'close' of null

I'm having the same error as @bluefate .
VSCode-Insiders version: 1.36.0

image

I found the same mistake
VSCode-Insiders version: 1.36.0-insider
image

VSCode version: 1.36.0
image

@lamqhoang @czgtest

Newest VSCode and Arduino plugin.
I'm not able to choose the correct port.
In the Arduino Ide everything works as expected
Screen Shot 2019-07-05 at 12 59 56

Explicity defining it in .vscode/adruino.json works
On mac with Arduino/Genuino Uno I use "port": "/dev/cu.usbmodem1421",

My arduino.json

{
    "sketch": "Blink.ino",
    "port": "/dev/cu.usbmodem1421",
    "board": "arduino:avr:uno",
    "programmer": "AVRISP mkII"
}

Serial monitor Problem persists tho
Failed to open serial port /dev/cu.usbmodem1421 due to error: + TypeError: Cannot read property 'close' of nu

same here

Have anyone found the solution for this issue?

rollback VSCode to 1.35

Thank you very much, rollback to 1.35 did the trick!

Here's the link if anyone need:
https://code.visualstudio.com/updates/v1_35

Yeah, 1.35 User worked out for me too. Thanks!!

1.36 generates no response when trying to change serial port, but 1.35 and 1.34 crashes the arduino extension when trying to change the port.

Unfortunately 1.40 breaks the com port again. 1.39.2 seems to work. (on Mac OSX at least)

袙袨孝 蟹邪褔械屑 写械谢邪褌褜 芯斜薪芯胁谢械薪懈褟 锌芯褋谢械 泻芯褌芯褉褘褏 薪械 褔械谐芯 薪械 褉邪斜芯褌邪械褌?????????????????

Was this page helpful?
0 / 5 - 0 ratings

Related issues

li3 picture li3  路  4Comments

shizn picture shizn  路  4Comments

kerrsmith picture kerrsmith  路  4Comments

clarkbremer picture clarkbremer  路  6Comments

vishnumaiea picture vishnumaiea  路  6Comments