nextjs - 💡(How to fix) Fix Proxy misleading outdated errors about Edge runtime when custom page extension is used [1 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#85646Fetched 2026-04-08 02:14:46
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
2
Author
Participants
Timeline (top)
labeled ×3subscribed ×3renamed ×2issue_type_added ×1

Error Message

I get the following error: Ecmascript file had an error I shouldn’t receive this error, because proxy don’t run on Edge Runtime according to the documentation: Runtime, Error Handling, Middleware, Not sure

Root Cause

I shouldn’t receive this error, because proxy don’t run on Edge Runtime according to the documentation:

Code Example

./proxy.universal.ts:17:25
Ecmascript file had an error
  15 |         Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  16 |      */
> 17 |     console.log(Boolean(process?.versions?.bun))
     |                         ^^^^^^^^^^^^^^^^^
  18 | }
  19 |
  20 | export const config = {

A Node.js API is used (process.versions at line: 17) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
    // custom pageExtensions 
    pageExtensions: ['tsx', 'ts', 'universal.ts', 'universal.tsx']
};

export default nextConfig;
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Git-I985/next-proxy-misleading-warnings

To Reproduce

  • Install dependencies (npm install or whatever).
  • Start the dev server (npm run start or your equivalent).
  • Open the app in your browser
  • Check console and terminal for errors

Current vs. Expected behavior

Current behavior

I get the following error:

 ⚠ ./proxy.universal.ts:17:25
Ecmascript file had an error
  15 |         Learn more: https://nextjs.org/docs/api-reference/edge-runtime
  16 |      */
> 17 |     console.log(Boolean(process?.versions?.bun))
     |                         ^^^^^^^^^^^^^^^^^
  18 | }
  19 |
  20 | export const config = {

A Node.js API is used (process.versions at line: 17) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Expected behavior

I shouldn’t receive this error, because proxy don’t run on Edge Runtime according to the documentation:

https://nextjs.org/docs/app/api-reference/file-conventions/proxy#runtime

A Node.js API is used (process.versions at line 17), which is not supported in the Edge Runtime. Learn more: https://nextjs.org/docs/api-reference/edge-runtime

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 9.11.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Runtime, Error Handling, Middleware, Not sure

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

next dev (local), next build (production)

Additional context

[!WARNING] The bug is reproducible only when a custom pageExtensions is configured and used.

https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
    // custom pageExtensions 
    pageExtensions: ['tsx', 'ts', 'universal.ts', 'universal.tsx']
};

export default nextConfig;

extent analysis

TL;DR

  • The issue can be resolved by modifying the proxy.universal.ts file to avoid using Node.js APIs not supported in the Edge Runtime or by adjusting the next.config.js to exclude universal.ts from the Edge Runtime.

Guidance

  • Review the proxy.universal.ts file and identify any Node.js APIs that are not supported in the Edge Runtime, such as process.versions.
  • Consider using a different approach that does not rely on Node.js APIs, or use a runtime check to ensure the code is running in a supported environment.
  • Adjust the next.config.js file to exclude universal.ts from being executed in the Edge Runtime, potentially by removing it from the pageExtensions array or using a custom configuration to handle this file type differently.
  • Verify that the custom pageExtensions configuration is the root cause of the issue by testing with the default configuration.

Example

// next.config.js
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  // Remove or modify the custom pageExtensions to avoid the issue
  pageExtensions: ['tsx', 'ts']
};

export default nextConfig;

Notes

  • The issue is specific to the next dev and next build stages, and is reproducible only when a custom pageExtensions is configured and used.
  • The universal.ts file is likely intended to run in a Node.js environment, but is being executed in the Edge Runtime due to the custom configuration.

Recommendation

  • Apply workaround: Modify the next.config.js file to exclude universal.ts from the Edge Runtime or adjust the proxy.universal.ts file to avoid using unsupported Node.js APIs. This approach allows for a quick resolution without requiring significant changes to the codebase.

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

nextjs - 💡(How to fix) Fix Proxy misleading outdated errors about Edge runtime when custom page extension is used [1 participants]