-
Notifications
You must be signed in to change notification settings - Fork 83
fix: throw precise, actionable error when downloaded deno cli is unusable #6708
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
Conversation
4440025 to
3865a70
Compare
There was a problem setting up the Edge Functions environment``` Error: There was a problem setting up the Edge Functions environment. To try a manual installation, visit https://ntl.fyi/install-deno. ``` This happens _a lot_: https://github.com/netlify/cli/issues?q=is%3Aissue%20%22There%20was%20a%20problem%20setting%20up%20the%20Edge%20Functions%20environment%22. It means we failed to download, install, or execute a local deno binary, or we're trying to use one that doesn't behave as expected or match the expected version range. This error message is imprecise and not very actionable. This commit bubbles the previously swallowed error details, adds more info, and adds a recommended step that [has been found to unblock users](netlify/cli#7700 (comment)) and which I've personally used to unblock myself.
3865a70 to
3f7574a
Compare
| Downloaded to: ${binaryPath} | ||
| Platform: ${process.platform}/${process.arch} | ||
| This may be caused by permissions, antivirus software, or platform incompatibility. |
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.
this line could be better 🤔
| Try clearing the Deno cache directory and retrying: | ||
| ${this.cacheDirectory} |
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.
I decided not to bother dynamically producing a platform-specific command here. I think users can figure out how to delete a directory.
| if (!version) { | ||
| this.logger.system(`getBinaryVersion no version found. binaryPath ${binaryPath}`) | ||
| return | ||
| return { error: new Error('Could not parse Deno version from output') } |
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.
should we include the full stdout here...?
Summary
This happens a lot: https://github.com/netlify/cli/issues?q=is%3Aissue%20%22There%20was%20a%20problem%20setting%20up%20the%20Edge%20Functions%20environment%22. It confuses and blocks our users and leads to frequent bug reports that are difficult for us to troubleshoot.
It means we failed to download, install, or execute a local deno binary, or we're trying to use one that doesn't behave as expected or match the expected version range.
This error message is imprecise and not very actionable.
This PR bubbles the previously swallowed error details, adds more info, and adds a recommended step that has been found to unblock users and which I've personally used to unblock myself.