eik-lib / issues

All Eik issues, bugs, questions etc goes here. Documentation is to be found at https://eik.dev
1 stars 0 forks source link

Unexpected token u in JSON at position 0 #9

Open mfolkeseth opened 2 years ago

mfolkeseth commented 2 years ago

Hi guys,

Yesterday we published a new new package with @eik/cli@2.0.1. Today when we run the meta command on the same package npx @eik/cli meta <package>, we get a Unexpected token u in JSON at position 0 error. Any idea what this might be?

digitalsadhu commented 2 years ago

Hmm, I just tried a couple packages using 2.0.1 with no issues. Is it just that one package that does it or do you have others that also give the same error?

mfolkeseth commented 2 years ago

I did the same test with some other new packges and it seemed to work fine. I guess the other issues we are having relates to some packages previously published with @eik/cli@1.x.x. We will do some cleanup on our end. Closing this for now.

Thanks!

mfolkeseth commented 2 years ago

Here is an update for you @digitalsadhu.

We did some more tests and it turns out that the error message in the issue title, relates to a missing --server-flag in the eik meta command. We tried to to run eik meta outside of the project folder and it makes sense that the cli does not know what eik server to ask meta information from. It would be good if the error message could let the user know what the issue is.

Which also lead us onto a few other points. The home folder contains tokens to servers you are authenticated to. What if the cli could do a server check against .eikrc when the folder has no eik.json and the server flag is missing. 🤔 I guess we thought that was the case, which is why we didn't think about providing the --server-flag initially.

digitalsadhu commented 2 years ago

ah that makes sense. We should improve the error handling on that for sure!