microsoft / tfs-cli

Cross-platform CLI for Microsoft Team Foundation Server and Visual Studio Team Services
MIT License
371 stars 131 forks source link

"A token is invalid" When Trying to Upload an Extension #431

Open mindlessroman opened 1 year ago

mindlessroman commented 1 year ago

Hey folks !

I am trying to upload an extension but am seeing the error of "A token is invalid. Refer to RFC 2616 for correct grammar of content types."

image

I've poked around like what's been described here: #414, and as far as I can tell the content types aren't badly formatted. I've also changed node and NPM to values others' said worked but no dice.

Is there any good way to see which token is invalid? And where? Otherwise this error message isn't very helpful and doesn't let me know what I need to fix.

mindlessroman commented 1 year ago

Also, if this needs to be in a different team's issues, I can do that.

LiliaSabitova commented 1 year ago

Hi @mindlessroman, thanks for reporting this issue. We are currently working on higher-priority issues, but we will investigate this issue later.

Ethan-Arrowood commented 1 year ago

I ran into this problem too, and at first didn't think that the solution in #414 applied to my project, but after running the unzip/zip workaround, my issue was resolved. I have a feeling that the arm64 mimetype piece isn't the only one that'd cause an issue so there may be something else that comes when a similar npm dependency is used on other systems like linux or windows.

The better solution is to figure out how to export strictly your tasks build and required dependencies. Using a tool like esbuild to bundle the task into a single export is best, because then you don't even have to upload any node_modules either.

veeranjaneya-reddy commented 2 months ago

We came across this issue and we changed nodejs version and it was resolved then.try giving >16.0.0 version

dbwodlf3 commented 4 days ago

:(:( I encountered the same issue.