hazel icon indicating copy to clipboard operation
hazel copied to clipboard

Keep getting "invalid JSON response" on private GitHub repo

Open ryandunnewold opened this issue 3 years ago • 6 comments

In the docs it says that private repos automatically sets the URL environment variable. It doesn't properly return it though and autoUpdater throws an error:

Here is original code: https://github.com/vercel/hazel/blob/a06e6c5e4acdab0339c14361f086c3f6ff8a10fc/lib/routes.js#L162-L169

Here is the solution that worked for me. Curious if there is a more elegant way to solve this:

 send(res, 200, {
    name: latest.version,
    notes,
    pub_date,
    url: shouldProxyPrivateDownload
      ? `https://${url}/download/${platformName}?update=true`
      : latest.platforms[platform].url
  })

ryandunnewold avatar Sep 24 '21 16:09 ryandunnewold

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

tarikhaiga avatar Oct 18 '21 02:10 tarikhaiga

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

You can edit the files directly in your Vercel hazel fork.

Juned-H2 avatar Dec 06 '21 15:12 Juned-H2

This is a showstopper bug on macOS that should really be handled immediately. Also the documentation for configuring the server address is missing the https:// prefix.

omerts avatar Jan 11 '22 09:01 omerts

@ryandunnewold Thanks for sharing this! I'm quite new here, not really sure how I can use your fix with my own private repo?

You can edit the files directly in your Vercel hazel fork.

I changed it in my fork, but it still returns the old url, is there any other step that needs to be done? like clearing the a cache?

EDIT: Ok figured it out, had to promote to production, and use the production link for it to work

omerts avatar Jan 11 '22 10:01 omerts

Same issue here, I will update it in my fork as well.

btribouillet avatar Jan 22 '22 05:01 btribouillet

I have same issue.

Request

https://my-hazel-server.vercel.app/update/darwin/0.1.8

Response

{"name":"v0.1.9","notes":null,"pub_date":"2022-06-14T05:50:23Z","url":"my-hazel-server.vercel.app.vercel.app/download/darwin?update=true"}

this response contains "url":"my-hazel-server.vercel.app.vercel.app/download/darwin?update=true". this is wrong url.

Nkzn avatar Jun 14 '22 11:06 Nkzn