(tooling): astro check pre-commit hook fails under bare Node v20 (not mise-pinned Node 22)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- bash, node.js
- Domain
- build-system, tooling
Research direction
Locate the pre-commit configuration containing the docs-astro-check entry and compare it with the existing mise-prefixed eslint and agent hooks. Reproduce the failure with an unactivated Node v20 environment, then verify that the hook uses the pinned Node 22 and that a plain commit touching docs passes.
Written by the indexing model from the issue text.
Description
Component
Documentation — repo tooling (prek astro check hook)
Describe the bug
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.
Current behavior
The hook:
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)/docs" && ./node_modules/.bin/astro check'
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 -vshowing v20), from the repo (or a worktree): - Edit any file under
docs/so the hook'sfiles: ^docs/pattern matches, andgit addit. git commit -m "docs: test".- Observe the
astro checkhook fail withNode.js v20.x is not supported by Astro. - Compare:
mise exec -- git commit -m "docs: test"passes the same hook (Node 22 onPATH).
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):
entry: bash -lc 'cd "$(git rev-parse --show-toplevel)/docs" && mise exec -- ./node_modules/.bin/astro check'
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.
- Dominant language
- TypeScript
- Stars
- 146
- Forks
- 46
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 27
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws-samples/sample-autonomous-cloud-coding-agents
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug v1
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
documentation P2 security
Difficulty 2/5 1-2 days Newbie friendliness 74/100
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
aws-samples/sample-autonomous-cloud-coding-agents#767 · 2 comments ·
All issues in aws-samples/sample-autonomous-cloud-coding-agents
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100