fix(deploy,web): drop stale npm lockfile, pin Bun, add Vercel Analytics#25
Merged
Conversation
Vercel was running 'npm install' (because root package-lock.json existed from before the Bun migration), then 'npm run build', and hitting the known npm bug with Rollup optional deps: Cannot find module @rollup/rollup-linux-x64-gnu Fixes: - Delete root package-lock.json (Bun is the canonical PM, bun.lock is the only lockfile in tree). - Add packageManager: bun@1.3.11 to root package.json so Vercel and Corepack pick the right tool unambiguously. - Add @vercel/analytics 2.0.1 to the website and inject() it from a client script in index.astro and legal.astro. Confirmed in built output: bundled and pinging /_vercel/insights. Build verified: bun install -> 325 packages, astro build -> 2 pages in 1.13s, no warnings beyond an unrelated Astro upstream Vite import note.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Vercel deploy of `sunat-cli-website` was failing on `main` after PR #24 with the classic npm + Rollup optional-deps bug:
```
Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related
to optional dependencies (npm/cli#4828).
```
Root cause: a stale `package-lock.json` from before the Bun migration was sitting in the repo root. Vercel's auto-detection saw it and ran `npm install` instead of `bun install`, then triggered the Rollup bug.
Fix
Test plan