← All fixes
Next.js warns it inferred the wrong workspace root (multiple lockfiles)
#9Error
Warning: Next.js inferred your workspace root, but it may not be correct. We detected multiple lockfiles and selected the directory of <home>/package-lock.json as the root directory.
Fix
A stray package-lock.json in a parent folder (often your home directory) confuses Next's file tracing. Either delete the stray lockfile if nothing uses it, or pin the root in next.config.mjs: import path from 'node:path'; import { fileURLToPath } from 'node:url'; export default { outputFileTracingRoot: path.dirname(fileURLToPath(import.meta.url)) };Did it work?
No reports yet0 worked0 didn't
Tried it yourself?
Related fixes
create-next-app fails: name can no longer contain capital letters
#8Could not create a project called "MyApp" because of npm naming restrictions: name can no longer contain capital letters
next build fails prerendering a page that queries the database
#4Error occurred prerendering page "/leaderboard". Error: DATABASE_URL is not set. Export encountered an error, exiting the build.
New Vercel environment variable is undefined in production
#6process.env.MY_VAR is undefined on the live site even though it was added in the Vercel dashboard.