Dev server fails to find a required manifest file, but works in production.
The issue involves a missing `app-paths-manifest.json` file in the Next.js dev server, causing errors when accessing a specific API route. The problem does not occur in production mode. The root cause is unclear, and it may require understanding Next.js's internal file handling during development.
https://github.com/TheodoreRed/reproduce-next-15.1.7-bug
Clone the repo and install dependencies:
npm install
Start the dev server:
npm run dev
Make a GET request to:
http://localhost:3000/api/dummy/982h89f9082h3/something
Observe the error in the terminal:
⨯ [Error: ENOENT: no such file or directory, open '/path/to/project/.next/server/app/api/dummy/[signal_id]/something/[__metadata_id__]/route/app-paths-manifest.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/path/to/project/.next/server/app/api/dummy/[signal_id]/something/[__metadata_id__]/route/app-paths-manifest.json'
}
Attempt removing the .next folder or clearing caches (e.g., rm -rf .next), then rerun npm run dev – the error persists.
Build and run in production mode (npm run build && npm run start) – the error does not occur.
Current Behavior:
ENOENT error whenever a request is made to /api/dummy/[signal_id]/something..next folder does not fix the issue.Expected Behavior:
app-paths-manifest.json when making requests to the API route.npx --no-install next info
/bin/sh: yarn: command not found
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122
Available memory (MB): 16384
Available CPU cores: 8
Binaries:
Node: 22.12.0
npm: 10.9.0
Yarn: N/A
pnpm: 9.15.0
Relevant Packages:
next: 15.1.7 // There is a newer version (15.2.0) available, u
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!