Tagged: deployment

Express.js

CORS error: No 'Access-Control-Allow-Origin' header is present on the requested resource

Your backend isn't sending CORS headers that allow your frontend's origin. Install and configure the `cors` package with your frontend's exact URL(s), and make sure it's applied before your routes are registered.

Draft·
Deployment

Vercel deployment error: Environment Variable references Secret which does not exist

An environment variable your app needs isn't set in your Vercel project settings for the environment you're deploying to (Production/Preview/Development each have separate values). Add it under Project Settings → Environment Variables, then redeploy.

Draft·
Deployment

Error: NEXT_PUBLIC_ environment variable is undefined in production but works locally

`NEXT_PUBLIC_` variables are inlined into your JavaScript bundle at build time, not read at runtime. If you added the variable after your last deploy, or only to certain environments, you need to trigger a fresh build for it to take effect.

Draft·
Nextjs

Error: Dynamic server usage: Page couldn't be rendered statically because it used `cookies`

Reading `cookies()`, `headers()`, or `searchParams` inside a page Next.js is trying to statically generate forces that route to render dynamically instead. If that's intended, add `export const dynamic = 'force-dynamic'` to opt in explicitly rather than letting the build warn about it.

Draft·
Deployment

Module not found: Can't resolve './Component' — works locally, fails on Vercel

Your local filesystem (macOS/Windows) is case-insensitive, but Vercel builds on Linux, which is case-sensitive. An import like `./Button` will resolve locally even if the file is actually named `button.tsx`, but fails on deploy. Fix the casing to match exactly.

Draft·
Deployment

Error: ENOENT: no such file or directory, open '.next/routes-manifest.json'

This means the app is trying to start (`next start`) before a full `next build` has actually completed and produced a `.next` folder. Confirm your deploy pipeline runs `next build` first, and that no earlier step in the build silently failed before reaching it.

Draft·
Deployment

Module not found: Can't resolve 'tailwindcss' after Vercel build

Vercel's production install can prune devDependencies before the build step in some configurations, so if `tailwindcss` (or another build-time tool) is listed only under `devDependencies`, the build can fail even though it works locally. Move build-critical packages to `dependencies`, or confirm your install command isn't skipping dev packages.

Draft·