-
-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Deno check precluding esm.sh to start #327
Conversation
server/nodejs.go
Outdated
@@ -633,7 +633,7 @@ func toTypesPackageName(pkgName string) string { | |||
} | |||
|
|||
func getDenoStdVersion() (version string, err error) { | |||
resp, err := httpClient.Get("https://cdn.deno.land/std/meta/versions.json") | |||
resp, err := http.Get("https://cdn.deno.land/std/meta/versions.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this because of the HTTP_PROXY issue you mentioned? If so, want to try to add Proxy
field to the Transport config, to see if it works for you? It's essentially dropping in this line:
Proxy: http.ProxyFromEnvironment,
right below this line
Line 34 in 46940b3
ResponseHeaderTimeout: 60 * time.Second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jimisaacs done, it seems to work. Thanks, go is not my usual language :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mine neither to be honest, I approved and am running the workflow, but I think @ije should give this change a look. I don't think that setting should have any overhead given that it's the default of go, but I wouldn't know at the scale @ije is operating this service.
FYI, the check failure looks unrelated to your change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -143,7 +143,7 @@ func Serve(efs EmbedFS) { | |||
|
|||
denoStdVersion, err = getDenoStdVersion() | |||
if err != nil { | |||
log.Fatalf("getDenoStdVersion: %v", err) | |||
log.Warnf("getDenoStdVersion: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are not comfortable with my suggestion, please add a TODO / FIXME here to look at it later.
In build.go
, there are places denoStdVersioin
is used (lines 487, 706, 713).
There, it needs to check if denoStdVersioin
is set, and if not build a string without it.
Example, this is what it would look like with it set: https://deno.land/std@0.139.0/archive/tar.ts
This is what it would look like without it set: https://deno.land/std/archive/tar.ts
The URL without it still works without the version with a redirect, so this is a valid change, but really only with the string update because that @
in the URL is invalid without a version there.
@@ -143,7 +143,7 @@ func Serve(efs EmbedFS) { | |||
|
|||
denoStdVersion, err = getDenoStdVersion() | |||
if err != nil { | |||
log.Fatalf("getDenoStdVersion: %v", err) | |||
log.Warnf("getDenoStdVersion: %v", err) | |||
} | |||
log.Debugf("https://deno.land/std@%s found", denoStdVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this to an else
, since it's not found ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR relates to #309
It essentially:
Http.Get
for it to honour env-defined http proxy URLs