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

Export NODE_OPTIONS env default to downstream buildpacks #1293

Merged
merged 3 commits into from
Jul 10, 2024

Conversation

colincasey
Copy link
Contributor

If the user has not set a custom NODE_OPTIONS environment variable, we automatically set NODE_OPTIONS="--max_old_space_size=2560" in the build environment. This setting helps to mitigate OOM issues that sometimes occur when asset compilation tools are used.

This setting is currently limited to the Node.js Buildpack's environment. To propagate this setting to downstream buildpacks such as the Ruby Buildpack (which sometimes requires Node to run asset compilation tasks too), this PR writes the setting to the <buildpack_dir>/export file. It will not export the setting if the user already has a custom NODE_OPTIONS environment variable.

@colincasey colincasey self-assigned this Jul 10, 2024
@colincasey colincasey requested a review from a team as a code owner July 10, 2024 16:42
lib/environment.sh Outdated Show resolved Hide resolved
@colincasey colincasey requested a review from edmorley July 10, 2024 19:12
@colincasey colincasey merged commit 032734b into main Jul 10, 2024
11 checks passed
@colincasey colincasey deleted the export_default_node_options branch July 10, 2024 19:52
@heroku-linguist heroku-linguist bot mentioned this pull request Jul 10, 2024
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.

2 participants