Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Hello World application crashes when export NODE_OPTIONS="--max_old_space_size=4096" is set #1194

Closed
Samulus opened this issue May 25, 2021 · 2 comments
Labels

Comments

@Samulus
Copy link

Samulus commented May 25, 2021

Reproduction steps:

  • echo "console.log('Hello World');" > hi.js
  • export NODE_OPTIONS=--max_old_space_size=4096
  • node hi.js // Prints Hello World as expected.
  • npx pkg hi.js

It prints out:

> [email protected]
> Targets not specified. Assuming:
  node14-linux-x64, node14-macos-x64, node14-win-x64

I run ./hi-linux and nothing is printed, $? shows error code 4 was returned. If we do export NODE_OPTIONS="--max_old_space_size=4096 --trace-exit" and then run ./hi-linux we get the following stack trace:

(node:754642) WARNING: Exited the environment with code 4
    at exit (internal/process/per_thread.js:174:13)
    at _compile (pkg/prelude/bootstrap.js:1682:29)
    at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Module._load (internal/modules/cjs/loader.js:774:14)
    at runMain (pkg/prelude/bootstrap.js:1739:12)
    at internal/main/run_main_module.js:17:47

I'm using Node v14.16.1 and pkg 5.2.1, let me know if I'm missing any reproduction info.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

@github-actions github-actions bot added the Stale label Aug 24, 2021
@github-actions
Copy link

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

jesec added a commit to vercel/pkg-fetch that referenced this issue May 1, 2022
Production binaries shall NOT take NODE_OPTIONS from end-users.

Only the users (developers who use pkg to package their project) should
have control over the flags via the "bake in" (--options) mechanism.

Bug: vercel/pkg#954, vercel/pkg#989, vercel/pkg#1194, vercel/pkg#1517
jesec added a commit to jesec/pkg-fetch that referenced this issue May 3, 2022
Production binaries shall NOT take NODE_OPTIONS from end-users.

Only the users (developers who use pkg to package their project) should
have control over the flags via the "bake in" (--options) mechanism.

Bug: vercel/pkg#954, vercel/pkg#989, vercel/pkg#1194, vercel/pkg#1517
Hypfer pushed a commit to Hypfer/pkg-fetch that referenced this issue May 7, 2022
Production binaries shall NOT take NODE_OPTIONS from end-users.

Only the users (developers who use pkg to package their project) should
have control over the flags via the "bake in" (--options) mechanism.

Bug: vercel/pkg#954, vercel/pkg#989, vercel/pkg#1194, vercel/pkg#1517
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
@Samulus and others