Error: app-paths-manifest.json not found in .next/server/app/.../route (works when running npm run build && npm run start, fails in npm run dev)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/TheodoreRed/reproduce-next-15.1.7-bug
To Reproduce
-
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
.nextfolder or clearing caches (e.g.,rm -rf .next), then rerunnpm run dev– the error persists. -
Build and run in production mode (
npm run build && npm run start) – the error does not occur.
Current vs. Expected behavior
Current Behavior:
- The development server throws the above
ENOENTerror whenever a request is made to/api/dummy/[signal_id]/something. - Clearing the
.nextfolder does not fix the issue. - Production mode builds and runs without error.
Expected Behavior:
- The development server should not crash or fail to find
app-paths-manifest.jsonwhen making requests to the API route. - The dev environment should run as smoothly as production does.
Provide environment information
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, upgrade recommended!
eslint-config-next: 15.1.7
react: 19.0.0
react-dom: 19.0.0
typescript: 5.5.4
Next.js Config:
output: N/A
⚠ There is a newer version (15.2.0) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
theo.redlon@Theos-MacBook-Air exlog-sparrowhawk-webapp %
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproduction repository, install dependencies, and run npm run dev before requesting /api/dummy/982h89f9082h3/something. Investigate Next.js 15.1.7 development handling for the app route and app-paths-manifest.json, then verify that the request succeeds in dev while npm run build && npm run start remains working.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, node.js, react
- Domain
- api, backend, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100