Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

fix(astro-markflow): use static import for writeFile in buildEnd hook - #176

Merged
jp-knj merged 1 commit into
mainfrom
fix/buildend-writeFile-static-import
Feb 2, 2026
Merged

fix(astro-markflow): use static import for writeFile in buildEnd hook#176
jp-knj merged 1 commit into
mainfrom
fix/buildend-writeFile-static-import

Conversation

@jp-knj

@jp-knj jp-knj commented Feb 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Fix buildEnd hook crash when MARKFLOW_STATS=1 — the dynamic await import('node:fs/promises') goes through Vite's module runner which is already closed by buildEnd time
  • Use the static writeFile import already at the top of vite-plugin.ts instead

Test plan

  • pnpm --dir packages/astro-markflow run typecheck passes
  • MARKFLOW_STATS=1 withastro-docs build no longer crashes in buildEnd

🤖 Generated with Claude Code

The dynamic `await import('node:fs/promises')` in buildEnd goes through
Vite's module runner, which is already closed by the time buildEnd fires.
Use the static import already available at the top of the file.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Feb 2, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@jp-knj
jp-knj merged commit 4b7d30c into main Feb 2, 2026
17 of 18 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant