Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Upload command sometimes fails because of an unknown flag #1319

Open
soul-codes opened this issue Aug 15, 2021 · 14 comments
Open

Upload command sometimes fails because of an unknown flag #1319

soul-codes opened this issue Aug 15, 2021 · 14 comments

Comments

@soul-codes
Copy link

Platform: Ubuntu 20.10.
Arduino version: CLI 0.13.0.

Using the Arduino CLI: Upload command sometimes results in the following error in the console:

Error: unknown flag: --build-path
Usage:
  arduino-cli upload [flags]

This seems to happen after the first succesful upload. I have output configured in arduino.json.

@piif
Copy link

piif commented Jan 16, 2022

I just got same issue, with arduino-cli v0.20.2 and arduino extension v0.4.10

"CLI:Upload" command works after replacing --build-path by --input-dir at line 615 of .vscode/extensions/vsciot-vscode.vscode-arduino-0.4.10/out/src/arduino/arduino.js but then the "Upload" button fails.
It's because first one calls arduino-cli upload command which accept input-dir option, but second uses arduino-cli compile --upload which accepts build-path options ...

Thus i added a inner if (buildMode !== BuildMode.CliUpload) at line 614 and it works, but I don't know what happens when an other programmer is used (BuildMode.CliUploadProgrammer case)

@gasparo
Copy link

gasparo commented Apr 27, 2022

This worked for me too.. Please change that on next release.

@cdealti
Copy link

cdealti commented Nov 14, 2022

Still present with Visual Studio Code extension for Arduino v0.4.12 with:

  • Arduino IDE v2.0.1
  • arduino-cli v0.28.0

@rr326
Copy link

rr326 commented Dec 8, 2022

I'll see if I can do a PR, but for now, at line 631 of 0.4.12

                if (this.useArduinoCli()) {
                    if (buildMode !== BuildMode.CliUpload) {
                        args.push("--build-path", buildDir);
                    } else {
                        args.push("--input-dir", buildDir)
                    }
                }

This DOES upload correctly, but doesn't rebuild. I don't know if that is as expected or a bug introduced by this change...

@craigdetter
Copy link

This exact error is occurring on these versions:

Arduino IDE v2.0.3
arduino-cli Version: 0.29.0 Commit: 76251df9 Date: 2022-11-16T14:49:42Z
VSCode: Version: 1.74.3
Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534
Date: 2023-01-09T17:05:47.808Z (1 wk ago)

VSCode Error- Unknown flag.txt

@dancesWithMachines
Copy link

Issue still present with extension v0.4.13

@GalBrandwine
Copy link

GalBrandwine commented Jun 25, 2023

Same for Version 0.6.0.

arduino-cli version                                                                                                                                           130 ↵ gal@gal-GP63-Leopard-8RE
arduino-cli  Version: 0.31.0 Commit: 940c9457 Date: 2023-02-22T16:15:52Z

@janoist1
Copy link

I'm getting the error too - late 2023.

@Tynopia
Copy link

Tynopia commented Dec 21, 2023

I'm getting this issue too

@Octahedron-Alum
Copy link

same here.

@willlogs
Copy link

willlogs commented Mar 5, 2024

Can't believe this bug is still present! Just change the flag

@voelkerb
Copy link

bump

@willlogs
Copy link

willlogs commented Apr 16, 2024 via email

@wrenchpilot
Copy link

I just ran into this when trying to use CTRL-SHIFT-P -> Arduino CLI: Upload Using Programmer

Try using CTRL-SHIFT-P -> Arduino: Upload Using Programmer (i.e. Don't use the Arduino CLI)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests