Skip to content

Short form --r node flag causing issues with latest Next.js dev servers #168

@PenguinDevs

Description

@PenguinDevs

When using HTTP Toolkit with the latest Next.js version (16.1.1) in a fresh terminal (same issue applies when invoking the script into an existing terminal), and run the server with npm run dev, I receive C:\nvm4w\nodejs\node.exe: --r= is not allowed in NODE_OPTIONS.

I believe this issue relates to vercel/next.js#77550, blaming the later versions of Next.js, rather than Node as older versions of Next.js such as 15.2.2 has no issues when being intercepted.

Interception works if only the long form --require flag is used, which

echo $NODE_OPTIONS
--require C:/Users/Jason/Documents/VSCode/Random/httptoolkit-server/overrides/js/prepend-node.js

It does seem to be correct, however, I've noticed that overrides\path\node and overrides\path\node.bat were the source of the -r flags being passed. I assume passing both the short form and long form flags of --require were meant to be like a bit of redundancy? Either way, I think that removing the short form flag should still allow the interception to be compatible with most popular node vendors I believe.

Environment

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32702
  Available CPU cores: 16
Binaries:
  Node: 24.12.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.28.0
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

httptoolkit-server: 1.24.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions