Skip to content
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

[RFC]: Passing NODE_OPTIONS #9234

Closed
1 task done
AlexAnarcho opened this issue Sep 23, 2023 · 1 comment · Fixed by #9585
Closed
1 task done

[RFC]: Passing NODE_OPTIONS #9234

AlexAnarcho opened this issue Sep 23, 2023 · 1 comment · Fixed by #9585

Comments

@AlexAnarcho
Copy link

Summary

This issue was raised as a result of this community forum entry.

TLDR:
Some libraries may require special NODE_OPTIONS to be passed, however this is currently not supported with any arguments (for example to the redwood.toml).

Motivation

Support of monero-javascript requires the --no-experimental-fetch flag to be passed in order to work with Node 18 LTS

Detailed proposal

When further testing the workaround described in the forum post, I found it annoying that anytime the @redwoodjs node_module changes, the manual changes become overwritten.

It would be ideal to have some place in the configuration of redwood to pass NODE_OPTIONS to any node process that runs the api side (or web side).

[api]
  port = 8911
  host = "0.0.0.0"
  node_options="--no-experimental-fetch"

I have looked into injecting this flag manually in the devHandler @redwoodjs/cli/dist/commands/devHanlder where --enable-source-maps is passed with NODE_OPTIONS="--enable-source-maps --no-experimental-fetch" but I don't know how to make it persistent across installs of redwoodjs. Also, this only seems to fix the yarn rw dev process, but not a baremetal deploy.

Generally I am interested on implementing this, but I am totally new and would probably need a lot of hand-holding. Let me know!

Are you interested in working on this?

  • I'm interested in working on this
@jtoar
Copy link
Contributor

jtoar commented Oct 26, 2023

Hey @AlexAnarcho, sorry for the late response, I think the issue is mainly that yarn rw dev isn't respecting user-specified NODE_OPTIONS. I don't believe the issue persists to other CLI commands, so I'm not sure if you need to worry about too much. It feels like we just need to fix devHandler by merging NODE_OPTIONS. How does that sound?

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 a pull request may close this issue.

2 participants