[CDTOOL-691] Better error reporting when JavaScript tools are missing#1640
Open
jedisct1 wants to merge 10 commits intofastly:mainfrom
Open
[CDTOOL-691] Better error reporting when JavaScript tools are missing#1640jedisct1 wants to merge 10 commits intofastly:mainfrom
jedisct1 wants to merge 10 commits intofastly:mainfrom
Conversation
3bf04e9 to
456d77b
Compare
Validate JavaScript toolchains before attempting a build, catching common setup issues early and providing accurate error messages instead of build failures. As Bun becomes increasingly popular, it’s not ideal to ask users to install Node when they already have Bun. So, this PR also adds proper support for Bun as an alternative runtime. The verification detects whether a project uses Node.js or Bun by checking for lockfiles, with support for Bun workspaces where the lockfile lives at the workspace root rather than in the subpackage. When something is missing, the error message now explains exactly what's wrong and how to fix it, whether that's installing a runtime, running npm install, or adding the @fastly/js-compute package.
As noted by @kpfleming: Most starter kits set scripts.build to "npm run build", which previously skipped all toolchain verification. Now we also verify when the build script matches known defaults like "npm run build" or "bun run build".
Build verification can also be triggered by "publish" or "serve", so telling the user to retry with "fastly compute build" is misleading. Suggested by @kpfleming, thanks!
Contributor
|
Pinging @harmony7, this is still waiting for a review. |
harmony7
requested changes
Apr 14, 2026
Member
harmony7
left a comment
There was a problem hiding this comment.
Thank you for putting this together!
I want to bring up a couple of points, I've placed comments inline. Since we're in here now improving this part, I think it's probably worth tidying these points up too. Please let me know if you have any thoughts.
* main: build(deps): bump the go-dependencies group with 5 updates (fastly#1726) release 14.3.1 (fastly#1725) Restore permission for trusted publishing (fastly#1724) Release 14.3.0 (fastly#1723) [CDTOOL-1193] Support for Logging Endpoint Errors (fastly#1721) chore(deps): bump go-fastly to 14.2.0 (fastly#1722) Add --json / -j flag to all stats subcommands (fastly#1719) build(deps): bump the go-dependencies group with 4 updates (fastly#1720) Add "auth revoke" subcommand for token revocation (fastly#1717) Restrict GitHub Actions workflow permissions to least privilege (fastly#1718)
harmony7
approved these changes
Apr 15, 2026
Member
harmony7
left a comment
There was a problem hiding this comment.
The changes look great!
I have one last comment, which can be considered non-blocking. Please review it, make the change if you think appropriate, and then go ahead and merge.
Thanks again for this great PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change summary
Validate JavaScript toolchains before attempting a build, catching common setup issues early and providing accurate error messages instead of build failures.
As Bun becomes increasingly popular, it’s not ideal to ask users to install Node when they already have Bun. So, this PR also adds proper support for Bun as an alternative runtime.
The verification detects whether a project uses Node.js or Bun by checking for lockfiles, with support for Bun workspaces where the lockfile lives at the workspace root rather than in the subpackage.
When something is missing, the error message now explains exactly what's wrong and how to fix it, whether that's installing a runtime, running npm install, or adding the @fastly/js-compute package.
All Submissions:
New Feature Submissions:
Changes to Core Features:
User Impact
Use get better guidance and can use Bun as an alternative Runtime.
Are there any considerations that need to be addressed for release?
No breaking changes.