Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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) #76766

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TheodoreRed opened this issue Mar 3, 2025 · 5 comments

Comments

@TheodoreRed
Copy link

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

@TheodoreRed
Copy link
Author

I attempted updating Next.js to canary with the following steps:

npm install next@canary
changed 3 packages, and audited 432 packages in 7s
149 packages are looking for funding
  run `npm fund` for details
found 0 vulnerabilities

Then, running the dev server again (npm run dev) produced these errors:

> [email protected] dev
> next dev --turbopack

   ▲ Next.js 15.2.1-canary.5 (Turbopack)
   - Local:        http://localhost:3000
   - Network:      http://192.168.2.216:3000
   - Environments: .env.local

 ✓ Starting...
 ✓ Ready in 2.9s
 ○ Compiling /api/dummy/[signal_id]/something ...
 ✓ Compiled /api/dummy/[signal_id]/something in 1430ms
 ⨯ ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Unknown module type
This module doesn't have an associated type. Use a known file extension, or register a loader for it.

Read more: https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders

./node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:76:15
Module not found: Can't resolve 'aws-sdk'
  74 |
  75 |   // if not mocking then setup real s3.
> 76 |   const AWS = require('aws-sdk');
     |               ^^^^^^^^^^^^^^^^^^
  ...
...
GET /api/dummy/982h89f9082h3/something 500 in 2406ms

After upgrading to Next.js 15.2.0 (canary), I’m now seeing these module resolution errors (e.g., aws-sdk, mock-aws-s3, nock) when using npm run dev with Turbopack.


@romakov

This comment has been minimized.

@mischnic
Copy link
Contributor

mischnic commented Apr 10, 2025

Ideally this wouldn't be necessary, but add pulsar-client to the serverExternalPackages: ['pulsar-client'] in next.config.js fixes those build errors.

This is the file that causes these problems by pulling in @mapbox/node-pre-gyp: https://github.com/apache/pulsar-client-node/blob/b79ead00441779a348e921f1aa638f1e2dce35c9/src/pulsar-binding.js#L19-L26
and then https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/node-pre-gyp.js#L286-L288

@Fredy
Copy link

Fredy commented Apr 10, 2025

@mischnic thanks for your findings. May I ask how do you found the root cause? I'm having the same issue in my project but I don't have pulsar-client as a depdendency

@mischnic
Copy link
Contributor

That is the workaround/fix for this error:

 ⨯ ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Unknown module type
This module doesn't have an associated type. Use a known file extension, or register a loader for it.

app-paths-manifest.json being missing points to the build failing for some reason (but not printing out the actual reason). So I don't know why that was the case originally here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants