WiFi Rev 2 not uploading: [SOLVED]

Hello there.
I am using Arduino WiFi rev2, the Arduino IDE, and Windows 10 computer.
I was getting this error while uploading my robot code:

avrdude: jtag3_edbg_send(): failed to send command to serial port
avrdude: failed to write 64 bytes to USB port

This would loop until the IDE crashed, and this was happening every time I tried to upload the code. I figured out what was wrong, so I won't post the code. The general gist of the code was: Connect to WiFi and Blynk servers, when data is received (Blynk Bridge widget), move accordingly.
I fixed this error by uploading a Blink (not Blynk) sketch:

/*
  Blink

  Turns an LED on for one second, then off for one second, repeatedly.

  Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
  it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
  the correct LED pin independent of which board is used.
  If you want to know what pin the on-board LED is connected to on your Arduino
  model, check the Technical Specs of your board at:
  https://www.arduino.cc/en/Main/Products

  modified 8 May 2014
  by Scott Fitzgerald
  modified 2 Sep 2016
  by Arturo Guadalupi
  modified 8 Sep 2016
  by Colby Newman

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Blink
*/

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

This worked for some reason, and now everything is working fine.
I just wanted to post this to help others with the same issue. This may be a repost, but I looked for a long time and could not find anything like this.

Thanks so much for taking the time to share your findings @smallguy89!

smallguy89:
now everything is working fine.

Are you now able to upload the original "Connect to WiFi and Blynk servers, when data is received (Blynk Bridge widget), move accordingly" sketch to the Uno WiFi Rev2 without getting that "failed to send command to serial port" error?