nextjs - 💡(How to fix) Fix Proxy.ts file not included on build with webpack - Next 16.01 [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#85513Fetched 2026-04-08 02:15:17
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
commented ×2closed ×1issue_type_added ×1labeled ×1

Error Message

Error: ENOENT: no such file or directory, lstat '/vercel/path0/apps/dikaioai/.next/server/proxy.js'

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:26 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

tbd

To Reproduce

  1. Rename middleware.ts to proxy.ts
  2. Run build on vercel using --webpack

Error: ENOENT: no such file or directory, lstat '/vercel/path0/apps/dikaioai/.next/server/proxy.js'

Current vs. Expected behavior

The expected would be to just work with proxy.ts as it is suggested to change

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:26 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 16
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

No response

extent analysis

TL;DR

The issue can likely be fixed by updating the build configuration to reference the renamed proxy.ts file instead of the original middleware.ts file.

Guidance

  • Verify that the proxy.ts file is correctly referenced in the build configuration and that there are no remaining references to middleware.ts.
  • Check the Vercel build settings to ensure that the --webpack flag is correctly configured to handle the renamed file.
  • Consider updating the next.config.js file to include a custom webpack configuration that accounts for the renamed proxy.ts file.
  • Review the file system and build output to ensure that the proxy.js file is being generated correctly during the build process.

Example

No code example is provided as the issue does not include sufficient code context.

Notes

The solution may depend on the specific build configuration and Vercel settings used in the project. Additional debugging may be required to identify the root cause of the issue.

Recommendation

Apply workaround: Update the build configuration to reference the renamed proxy.ts file, as this is likely to resolve the issue without requiring a version upgrade.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING