Skip to content

fix(docs): cap esbuild at 0.27.5#9041

Closed
risu729 wants to merge 3 commits intojdx:mainfrom
risu729:fix/docs-esbuild-regression
Closed

fix(docs): cap esbuild at 0.27.5#9041
risu729 wants to merge 3 commits intojdx:mainfrom
risu729:fix/docs-esbuild-regression

Conversation

@risu729
Copy link
Copy Markdown
Contributor

@risu729 risu729 commented Apr 10, 2026

Summary

  • Cap the docs build esbuild resolution at 0.27.5 instead of fully reverting to 0.21.5. This is the highest published version I found that keeps bun run docs:build green: npm has no 0.27.6, 0.27.7 fails, and 0.28.0 fails.
  • Expand docs workflow path filters so Renovate dependency PRs and docs build inputs trigger docs CI: package.json, bun.lock, mise.toml, settings.toml, registry/**, tasks.toml, tasks/docs/**, xtasks/docs/**, .github/actions/**, and this workflow.

Related

I did not find matching Vite, VitePress, or vitepress-plugin-tabs issues by the failure text / esbuild Safari search terms.

Verification

  • Reproduced failure locally with esbuild 0.28.0: bun run docs:build fails with the same destructuring transform errors as feat(tasks): add extend mode for task includes #9038
  • Confirmed esbuild 0.27.7 also fails locally with a destructuring transform error
  • Confirmed esbuild 0.27.5 passes locally
  • bun install --frozen-lockfile
  • bun run docs:build
  • actionlint .github/workflows/docs.yml

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Greptile Summary

This PR reverts the esbuild 0.28.0 bump that broke the VitePress docs build with a destructuring transform error, and pins esbuild to 0.27.5 via a resolutions field in package.json. Additionally, the docs CI workflow path filters are expanded to trigger on dependency lockfile/config changes, reducing the chance a similar regression goes undetected.

Confidence Score: 5/5

Safe to merge — the regression is correctly reverted, the version pin is consistent throughout the lockfile, and the CI path filter expansion is well-scoped.

No new P0/P1 findings. The version 0.27.5 satisfies all transitive semver constraints in the lockfile. The lockfile is fully consistent with the resolution pin. The expanded CI path filters cover all known docs-build inputs. The only open concern (broad resolution override) was raised in a prior review comment and is P2 in nature.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/docs.yml Path filters expanded from just docs/** and tasks/docs/** to also cover bun.lock, package.json, mise.toml, settings.toml, tasks.toml, xtasks/docs/**, registry/**, .github/actions/**, and the workflow file itself — all verified to exist in the repo.
package.json Adds resolutions: { "esbuild": "0.27.5" } to pin the version across the entire install; 0.27.5 satisfies all transitive semver constraints (tsx ~0.27.0, module-from-string ^0.23.0) in the lockfile.
bun.lock Lockfile updated to reflect esbuild 0.27.5 for all platform-specific @esbuild/* packages, consistent with the resolutions pin.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push / PR to main] --> B{Path filter match?}
    B -- "docs/**, registry/**, settings.toml\nmise.toml, tasks.toml, tasks/docs/**\nxtasks/docs/**" --> C[Docs CI triggered]
    B -- "bun.lock, package.json" --> C
    B -- ".github/workflows/docs.yml\n.github/actions/**" --> C
    B -- No match --> X[Workflow skipped]
    C --> D[bun i]
    D --> E[mise run docs:release]
    E --> F{Push to main?}
    F -- Yes --> G[Deploy to Cloudflare]
    F -- No --> H[Dry run / PR preview check]
Loading

Reviews (2): Last reviewed commit: "fix(docs): use esbuild 0.27.5" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request downgrades esbuild to version 0.21.5 in package.json and bun.lock. Feedback indicates that this version may cause runtime failures due to conflicts with tsx and lacks support for several platforms included in the previous version. A suggestion was provided to use version 0.24.2 as a more compatible alternative that still addresses the underlying build issues.

Comment thread package.json Outdated
Comment thread package.json
@risu729 risu729 marked this pull request as draft April 10, 2026 22:14
@risu729 risu729 changed the title fix(docs): revert esbuild 0.28 regression fix(docs): cap esbuild at 0.27.5 Apr 10, 2026
@risu729 risu729 marked this pull request as ready for review April 10, 2026 22:49
jdx added a commit that referenced this pull request Apr 11, 2026
esbuild 0.28.0 updated its compat table to flag Safari <14.1
destructuring bugs, causing VitePress builds to fail. Setting
build.target to es2022 avoids the issue since the docs site
doesn't need to support ancient browsers.

Also expands docs CI path filters so dependency changes (bun.lock,
package.json, etc.) trigger the docs workflow.

Closes #9041

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jdx
Copy link
Copy Markdown
Owner

jdx commented Apr 11, 2026

Superseded by a new PR that upgrades esbuild to 0.28.0 instead of pinning to an older version. The fix is setting build.target: "es2022" in the VitePress Vite config so esbuild doesn't try to transform destructuring for old Safari. The CI path filter expansion from this PR is also included. Thanks for the thorough investigation @risu729!

This comment was generated by Claude Code.

@jdx jdx closed this Apr 11, 2026
@risu729 risu729 deleted the fix/docs-esbuild-regression branch April 11, 2026 12:47
jdx added a commit that referenced this pull request Apr 11, 2026
## Summary
- Upgrades esbuild from 0.21.5 to 0.28.0 instead of pinning to an older
version
- Sets `build.target: "es2022"` in VitePress Vite config to avoid Safari
<14.1 destructuring transform errors (the docs site doesn't need to
support ancient browsers)
- Expands docs CI workflow path filters so dependency changes
(`bun.lock`, `package.json`, etc.) trigger the docs build — prevents
regressions like this from slipping through

## Context
esbuild 0.28.0 updated its browser compat table to flag a Safari <14.1
destructuring bug
([esbuild#4436](evanw/esbuild#4436),
[esbuild#3743](evanw/esbuild#3743)). Since
esbuild lacks a destructuring transform, it errors out when targeting
old Safari. The fix recommended by the esbuild maintainer is to either
raise the target or use `--supported:destructuring=true`. Setting
`target: "es2022"` is the cleaner approach for a docs site.

Supersedes #9041 — thanks @risu729 for the investigation and CI path
filter improvements which are included here.

## Test plan
- [x] `bun run docs:build` passes locally with esbuild 0.28.0
- [x] All lints pass (`hk fix`)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Moderate risk because it changes the docs build toolchain (esbuild
version and Vite build target), which could affect bundle output and CI
behavior, but it’s isolated to documentation tooling.
> 
> **Overview**
> Upgrades the docs build’s pinned `esbuild` version from `0.21.5` to
`0.28.0` (via `package.json` resolutions and `bun.lock`).
> 
> Updates the VitePress Vite config to build with `target: "es2022"` to
avoid older-Safari transform issues.
> 
> Expands the `docs` GitHub Actions workflow path filters so docs CI
runs when tooling/dependency/config files (e.g. `bun.lock`,
`package.json`, various `*.toml`, `registry/**`, `xtasks/docs/**`)
change, not just `docs/**`.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
da6a10c. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants