← 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
ERR_PACKAGE_PATH_NOT_EXPORTED when importing a file deep inside a package
#29Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/helper' is not defined by "exports" in /app/node_modules/mylib/package.json
ERR_PNPM_OUTDATED_LOCKFILE: Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date
#175ERR_PNPM_OUTDATED_LOCKFILE Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up to date with package.json
ImportError: attempted relative import with no known parent package
#47ImportError: attempted relative import with no known parent package
pythonVerifiedNo reports yet