Skip to content

Fix: remove unneeded @std/dotenv/load import breaking Vercel deployment - #471

Closed
diogocouto18 wants to merge 1 commit into
ryo-ma:masterfrom
diogocouto18:master
Closed

diogocouto18 wants to merge 1 commit into
ryo-ma:masterfrom
diogocouto18:master

Conversation

@diogocouto18

Copy link
Copy Markdown

Problem

Deploying this project to Vercel (via the vercel-deno runtime declared in vercel.json) fails on every request with a 500 error:

TypeError: JSR package manifest for '@std/dotenv' failed to load. Read-only file system (os error 30)

Cause

api/index.ts imports @std/dotenv/load, which loads a local .env file into Deno.env. On Vercel this import is resolved lazily at request time by the vercel-deno runtime, which tries to write to its JSR dependency cache — but Vercel's serverless function filesystem is read-only, so the import fails and every request 500s.

The import isn't actually needed in this environment: Vercel already injects environment variables directly into the process, so there's no .env file to load in the first place.

Fix

Remove the import "@std/dotenv/load"; line. No other changes.

Testing

Verified on a personal fork deployed to Vercel: before the fix, every request returned 500 FUNCTION_INVOCATION_FAILED; after removing the import, the trophy SVG renders correctly.

The @std/dotenv/load import is for reading a local .env file, which
isn't needed on Vercel (env vars are injected directly into the
process). The vercel-deno runtime couldn't resolve the JSR subpath
import at request time (read-only filesystem), causing every request
to 500.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuvPSLEqW2zd8CbM2cbEdF
@diogocouto18

Copy link
Copy Markdown
Author

Closing in favor of #469, which reaches the same root cause fix (bare @std/dotenv/load specifier failing to resolve under vercel-deno on Vercel's read-only filesystem) via a better-preserving approach — it keeps local .env loading working via deno.land/std, whereas this PR just removes the import outright. Left a confirmation review on #469 since I independently reproduced and tested the same issue.

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.

1 participant