vercel / vercel/next.js

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)

Open
#76,766 6 comments 6 reactions 0 assignees View on GitHub

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
  1. Clone the repo and install dependencies:

    npm install
    
  2. Start the dev server:

    npm run dev
    
  3. Make a GET request to:

    http://localhost:3000/api/dummy/982h89f9082h3/something
    
  4. 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'
    }
    
  5. Attempt removing the .next folder or clearing caches (e.g., rm -rf .next), then rerun npm run dev – the error persists.

  6. 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 ENOENT error whenever a request is made to /api/dummy/[signal_id]/something.
  • Clearing the .next folder 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.json when 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.