Skip to content

Conversation

@PenguinDevs
Copy link

See #168.

@CLAassistant
Copy link

CLAassistant commented Jan 10, 2026

CLA assistant check
All committers have signed the CLA.

@pimterry
Copy link
Member

Thanks for the PR @PenguinDevs!

This is indeed sort-of redundant (in that injecting the prepend-node.js script should be handled by $NODE_OPTIONS in most cases) but this script exists specifically to cover the case where that doesn't work. There's a few different scenarios where that variable gets reset by something or is ignored for some reason, and so this wrapper acts as a fallback. Without the -r here this script basically does nothing at all.

I think we could just change from -r to --require though, if that works. Can you try that change here instead, and test whether it works for your case?

@PenguinDevs
Copy link
Author

After changing -r to --require, I end up with the error that:

Error: Cannot find module 'C:\Users\Jason\Documents\VSCode\Random\httptoolkit-server\overrides\path\..\js\prepend-node.js C:/Users/Jason/Documents/VSCode/Random/httptoolkit-server/overrides/js/prepend-node.js'

Which seems like two identical paths - except one is in backslashes, and the other uses forward slashes - are concatenated together? Again, this also only exclusively happens with the newer Next.js versions mentioned in #168 but isn't an issue with older ones. I am able to npm run dev on an older Next.js project with either -r or having it replaced with --require works.

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

Whether I included the --require or not, it was still being passed to the NODE_OPTIONS, hence why I had omitted it in the PR.

Although I understand that there might be a few scenarios where these options aren't passed to node, what I'm dealing with also appears to be a one-off scenario, too, with the latest Next.js version.

On a side note, I've been finding this tool very handy in various situations and projects. Thank you so much for the Pro account for free use during my studies!

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

Successfully merging this pull request may close these issues.

3 participants