You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(tooling): astro check pre-commit hook fails under bare Node v20 (not mise-pinned Node 22) #652
The docs-astro-check pre-commit hook invokes ./node_modules/.bin/astro check via a bare bash -lc, which resolves node from the login shell's PATH. When mise's shell hook isn't active in that shell (non-interactive shells, spawned/agent shells, and any environment where mise activation hasn't run), node is an older system version (e.g. v20), and the hook fails:
astro check (docs)....Failed
- hook id: docs-astro-check
- exit code: 1
Node.js v20.20.2 is not supported by Astro!
Please upgrade Node.js to a supported version: ">=22.12.0"
The repo pins Node 22 via mise (node = "22" in the root and docs/mise.toml), so the intended Node is fine — the hook just doesn't guarantee it's the one on PATH at commit time.
Expected behavior
git commit runs the astro check hook with the mise-pinned Node 22 regardless of whether the invoking shell has mise activated, so it passes in CI, interactive, and non-interactive/agent shells alike.
bash -lc sources the login profile but does not necessarily activate mise (mise activation is a shell hook, not part of every profile). So the node that runs astro check is whatever's first on PATH — system v20 in a plain shell — and Astro rejects it (>=22.12.0 required). Committing succeeds only when the invoking process already has mise's Node 22 on PATH (e.g. running the commit through mise exec -- git commit).
Reproduction steps
In a shell without mise activation (or node -v showing v20), from the repo (or a worktree):
Edit any file under docs/ so the hook's files: ^docs/ pattern matches, and git add it.
git commit -m "docs: test".
Observe the astro check hook fail with Node.js v20.x is not supported by Astro.
Compare: mise exec -- git commit -m "docs: test" passes the same hook (Node 22 on PATH).
Possible solution
Pin the hook to the mise-managed Node so it doesn't depend on ambient shell activation, e.g. run the command under mise exec (mirroring how the eslint/agent hooks already invoke mise tasks):
or route it through a mise task (e.g. mise //docs:astro-check) as the other language-specific hooks do (mise //cli:eslint, mise run quality). The eslint and agent hooks already prefix with mise, so this is a consistency gap in the docs hooks specifically.
Node version
System node v20.20.2 (bare shell); mise-pinned v22.23.1 when activated.
mise version
2026.7.13
Additional context
Surfaced while committing from a worktree via the standard AGENTS.md workflow. The docs-sync hook in the same repo has a separate worktree-specific failure (filed separately). Both mean a plain git commit touching docs/ currently needs mise exec -- to succeed.
Fixed by #1035 (merged 2026-11-16 as 7539ba1; commit fb50d0a of that pull request): the docs-astro-check hook asks mise for the Node of the docs package (mise which node) and puts its directory first on PATH for astro check (.pre-commit-config.yaml:84-88), so the hook no longer depends on the committing shell having mise activated. mise exec, as proposed here, was not used: in the hook's login shell on macOS it still ran the system Node when the committing shell had mise activated. Checked on main (3dbfada) on a machine whose own Node is 22.20.0, too old for astro 7.4.10: with and without mise activation the previous command stops at "Node.js v22.20.0 is not supported by Astro!", and the command on main starts astro on mise's Node 22.23.4. The other docs hooks run as mise tasks with MISE_ACTIVATE_AGGRESSIVE=1 since #1052. As for every hook of the repository, the mise binary has to be on the PATH of the login shell.
Posted from an automated sweep of the open issues. Each pull request, commit and file named above was checked against main at 3dbfada1. The issue is left open for a maintainer to close.
Activity
krokoko commentedon Nov 20, 2026
Triage: this looks resolved on
main.Fixed by #1035 (merged 2026-11-16 as 7539ba1; commit fb50d0a of that pull request): the
docs-astro-checkhook asks mise for the Node of the docs package (mise which node) and puts its directory first onPATHforastro check(.pre-commit-config.yaml:84-88), so the hook no longer depends on the committing shell having mise activated.mise exec, as proposed here, was not used: in the hook's login shell on macOS it still ran the system Node when the committing shell had mise activated. Checked on main (3dbfada) on a machine whose own Node is 22.20.0, too old for astro 7.4.10: with and without mise activation the previous command stops at "Node.js v22.20.0 is not supported by Astro!", and the command on main starts astro on mise's Node 22.23.4. The other docs hooks run as mise tasks withMISE_ACTIVATE_AGGRESSIVE=1since #1052. As for every hook of the repository, themisebinary has to be on thePATHof the login shell.Posted from an automated sweep of the open issues. Each pull request, commit and file named above was checked against
mainat3dbfada1. The issue is left open for a maintainer to close.