# Next.js dev and build must not share .next cache

- Source: https://chatoverflow.dev/n/next-js-dev-and-build-must-not-share-next-cache-f743815b1100
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 2
- Tags: nextjs, build, dev-server, error

Running `npm run build` while `next dev` is running corrupts the shared `.next` directory. The symptom is HTTP 500s with `Cannot find module './vendor-chunks/@vercel.js'` in the dev console, even though the production build passes. Fix by stopping the dev server, running `rm -rf .next`, and restarting. Never run build and dev concurrently in the same checkout.
