Skip to content

fix(deps): pin astro's vite to ^7 (scoped override)#155

Merged
omercnet merged 1 commit into
mainfrom
fix/pin-astro-vite-7
Apr 30, 2026
Merged

fix(deps): pin astro's vite to ^7 (scoped override)#155
omercnet merged 1 commit into
mainfrom
fix/pin-astro-vite-7

Conversation

@omercnet
Copy link
Copy Markdown
Contributor

@omercnet omercnet commented Apr 30, 2026

Summary

Fixes the intermittent "Deploy Preview" CI failure where astro build crashes with Not implemented inside vite/dist/node/chunks/node.js:33831 during PluginContextImpl.generateBundle.

Root cause

  • astro@6.1.9 declares "vite": "^7.3.2" as a dep
  • Root apps/ui/package.json pins "vite": "^8.0.0" (UI ships on Rolldown vite)
  • Bun was sometimes hoisting Vite 8 into astro's resolution depending on install order
  • Vite 8 uses Rolldown, whose PluginContext API is incomplete (see rolldown/rolldown#4973, rolldown/rolldown#6634)
  • Astro 6.x is officially Vite 7-only; Vite 8 support lands in astro 7
  • This is exactly the hoisting flake the astro team documented in withastro/astro#16062

Fix

Scoped overrides so astro always gets Vite 7, while apps/ui keeps Vite 8 + Rolldown:

"overrides": {
  "astro>vite": "^7.3.2"
}

Why arrow syntax (not nested)

Bun does not support npm's nested-object override syntax (warns and silently ignores it). Bun does accept the npm parent>child arrow form. Verified after install: bun.lock resolves astro/vite7.3.2 while the root vite stays at 8.0.10. UI's @vitejs/plugin-react@6.0.1 peer dep on Vite 8 is preserved.

Verification

Both builds pass locally:

Build Result
bun run --cwd apps/docs build 35 pages built in 3.97s
bun run --cwd apps/ui build Built in 443ms

CI's Deploy Preview + Bundle Analysis will confirm.

When to remove

Drop this override once we upgrade to astro 7 (which supports Vite 8 natively).


Summary by cubic

Pin astro’s Vite to ^7 using a scoped override to stop intermittent docs build crashes in Deploy Preview CI, while keeping apps/ui on vite ^8.
This ensures stable astro build runs without changing the UI build.

  • Bug Fixes
    • Enforced overrides: { "astro>vite": "^7.3.2" } so astro@6.x always uses Vite 7.
    • Prevents Bun from hoisting vite 8 (Rolldown) into astro, which caused “Not implemented” in PluginContext.generateBundle during astro build.
    • apps/ui stays on vite ^8 and @vitejs/plugin-react; no behavior change.
    • Uses arrow override syntax since Bun ignores nested overrides.
    • Remove the override after upgrading to astro@7 (Vite 8 support).

Written for commit df7112f. Summary will update on new commits. Review in cubic

Astro 6.1.9 declares 'vite: ^7.3.2' as its dep, but bun was hoisting
the root's vite ^8.0.0 (used by apps/ui) into astro's resolution. Vite
8 ships Rolldown, which has incomplete plugin API coverage —
PluginContext.generateBundle throws 'Not implemented', crashing the
astro docs build intermittently in Deploy Preview CI.

Fix: scoped npm-style override 'astro>vite: ^7.3.2' so astro gets its
own Vite 7 install while apps/ui keeps Vite 8 + Rolldown. Both builds
verified locally:
  - apps/docs build: 35 pages in 3.97s
  - apps/ui build:   succeeds in 443ms

Bun does NOT support nested override syntax (warns and ignores), but
DOES accept npm's 'parent>child' arrow form. Verified by inspecting
bun.lock: 'astro/vite' resolves to 7.3.2, root 'vite' stays at 8.0.10.

Remove this override once astro 7 (which supports vite 8) lands and
we upgrade.
Copilot AI review requested due to automatic review settings April 30, 2026 10:28
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Pins Astro’s internal Vite dependency to the Vite 7 line (while preserving Vite 8 for apps/ui) to prevent intermittent astro build failures caused by Bun hoisting Vite 8/Rolldown into Astro’s dependency graph.

Changes:

  • Add a root package.json scoped override (astro>vite) to force Astro to resolve Vite ^7.3.2.
  • Update bun.lock to reflect the new override and the resulting resolution (astro/vite7.3.2, root vite stays on 8.0.10).
  • Minor churn/reorder in .beads/issues.jsonl.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
package.json Adds scoped dependency override so Astro always gets Vite 7.
bun.lock Persists the override + resulting dependency graph (Astro uses Vite 7; root uses Vite 8).
.beads/issues.jsonl Reorders/re-adds an existing memory entry (unrelated to dependency fix).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .beads/issues.jsonl
@github-actions
Copy link
Copy Markdown

Preview Environment

Stage: pr-155

Resource URL
API https://api.pr-155.procella.cloud
App https://app.pr-155.procella.cloud
Docs https://docs.pr-155.procella.cloud

Deployed via SST to us-east-1. Domains: *.pr-155.procella.cloud

@omercnet omercnet merged commit 4ccdee1 into main Apr 30, 2026
26 checks passed
@omercnet omercnet deleted the fix/pin-astro-vite-7 branch April 30, 2026 11:32
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Bundle Report

Changes will increase total bundle size by 66 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
procella-ui-esm 1.47MB 66 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: procella-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 66 bytes 533.37kB 0.01%

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