wildcard/caro

Vercel caro-foss-website deploy fails: @astrojs/vercel resolves root astro 5.16.11 (missing applyPolyfills)

Closed

#1,309 opened on Jul 12, 2026

 (6 comments) (0 reactions) (0 assignees)Rust (6 forks)auto 404
awaiting-responsebugdependenciesdocumentationenhancementhelp wantedpriority/high

Repository metrics

Stars
 (35 stars)
PR merge metrics
 (PR metrics pending)

Description

[agent]

Agent: Claude Code (claude-opus-4-8)


Summary

The caro-foss-website Vercel deployment has been failing on every branch — including target: production builds on main (#1304 v1.5.0, #1305, #1306 all state: ERROR). It is a pre-existing baseline failure, acknowledged but not yet root-caused (see #1246 commit 934776bd: "the pre-existing Vercel caro-foss-website failure is out of scope (tracked separately)"). This issue is the "separately."

Error

✗ Build failed
../node_modules/@astrojs/vercel/dist/serverless/polyfill.js (1:9):
"applyPolyfills" is not exported by
"node_modules/astro/dist/core/app/entrypoints/node.js",
imported by "../node_modules/@astrojs/vercel/dist/serverless/polyfill.js".

Root cause — npm workspace hoisting conflict

This is a monorepo with workspaces (website, docs-site, landing, …). Resolving the committed root package-lock.json:

Path astro version
node_modules/astro (root, hoisted) 5.16.11
node_modules/@astrojs/vercel (root, hoisted) 9.0.5
website/node_modules/astro 6.1.10
docs-site / landing nested astro 6.1.10

@astrojs/vercel@9.0.5 expects astro 6 (applyPolyfills was introduced in the astro-6 astro/app/node entrypoint). But because the adapter is hoisted to the repo root, npm resolves its astro import against the root node_modules/astro = 5.16.11, which does not export applyPolyfills. The build crashes at the Vercel serverless polyfill.

website/node_modules/astro is correctly 6.1.10, but the root-hoisted adapter never sees it.

Verified locally: import('astro/app/node') from website/ (astro 6.1.10) exports applyPolyfills; the root-hoisted astro 5.16.11 does not.

Why root astro is pinned to 5.x

Something in the workspace tree forces the root hoist to astro 5.16.11 while website wants ^6.1.10. Candidates: a sibling workspace or the root package.json still declaring astro@^5, or @astrojs/db@^0.14.1 peer-pinning astro 5. Needs a npm ls astro audit across all workspaces.

Suggested fixes (pick one)

  1. Align all workspaces + root to astro 6.x so the hoist is astro 6 and the adapter resolves applyPolyfills. Cleanest, but a multi-workspace dependency bump + lockfile regen.
  2. Pin @astrojs/vercel to a version matching the hoisted astro 5.16.11 (adapter v8.x expects astro 5). Smaller, but freezes the website on astro 5 semantics.
  3. De-hoist: force @astrojs/vercel to resolve website's nested astro 6 (npm overrides or moving the adapter dep into the website workspace only).

Impact

The public website (caro.sh) cannot deploy from main at all until this is fixed — every production deploy is red. High priority for a project whose landing page is the primary user touchpoint.

Not caused by

Feature PRs that don't touch package-lock.json (e.g. the Flox use-case PR #1308) inherit this red check but do not cause it — their own pages build fine ("Processed: /use-cases/…" succeeds before the adapter-polyfill crash).

Contributor guide