Com port failed to connect in Visual Studio?

Uploading to devices was working fine, up until a couple of days ago.
Now I get error:
serial.serialutil.SerialException: could not open port ‘/dev/cu.SLAB_USBtoUART’: FileNotFoundError(2, ‘The system cannot find the path specified.’, None, 3)
The only way i could get it working again was. access the COM port directly by

commenting this out:
//upload_port = /dev/cu.SLAB_USBtoUART
//monitor_port = /dev/cu.SLAB_USBtoUART

And adding this in
upload_port = COM4 //added this to get it working.
monitor_port = COM4 //
but i have to run Arduino IDE to check what port my modules are on and edit above to match the port each time. I have loaded the drivers again in Windows 10. But problem persists?

The cu slab thing is due to a check-in to platformio.ini. it is what osx calls serial ports. We should probably just comment that line out in source control. Because it is different for all three oses.

Yeah, that’s my bad. That should not have been checked in.