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

Packaged apps crash with zero messaging when NODE_OPTIONS is set #1517

Closed
gluxon opened this issue Feb 15, 2022 · 7 comments
Closed

Packaged apps crash with zero messaging when NODE_OPTIONS is set #1517

gluxon opened this issue Feb 15, 2022 · 7 comments

Comments

@gluxon
Copy link

gluxon commented Feb 15, 2022

What version of pkg are you using?

5.5.2

What version of Node.js are you using?

v17.5.0

What operating system are you using?

macOS, Ubuntu 20.04.3

What CPU architecture are you using?

x86_64

What Node versions, OSs and CPU architectures are you building for?

node14-linux-x64, node14-macos-x64

Describe the Bug

Hi, this is a duplicate of #484. It doesn't look like the community can re-open issues, so I'd like to create a new issue to get visibility from the team on a serious vercel/pkg bug.

With latest Node 16, the binary built with pkg exits immediately. We have no warning "Pkg: FLAGS_MISMATCH".

#484 (comment)

We're seeing this over in the pnpm repo: pnpm/pnpm#4319. Thanks in advance for any help.


@BlackHole1 compiled a list of existing closed issues. Copying for visibility.

Expected Behavior

A warning for mismatched NODE_OPTIONS flags is printed.

To Reproduce

❯ NODE_OPTIONS="--max-old-space-size=4096" pnpm

❯ echo $?           
4

I'm using the pnpm binary as an example, but I believe this will happen for any pkg binary from looking over previous tickets.

@robertsLando
Copy link
Contributor

@gluxon Are you running it from vscode terminal? If so try with another terminal not in vscode application

@jesec Any clue about what could cause this?

@timonag
Copy link

timonag commented Feb 24, 2022

I can add that an app packaged with --public flag does not fail when NODE_OPTIONS is not empty.

@gluxon
Copy link
Author

gluxon commented Feb 24, 2022

Are you running it from vscode terminal? If so try with another terminal not in vscode application

Hey @robertsLando, thanks for the help. Apologies for missing the comment until now. I switched to the regular JavaScript version of pnpm personally, but was looking to deploy the vercel version on our team's development container. Some of my teammates use VS Code's integrated terminal from that development container, and I'd like them to continue to be able to do that?

@robertsLando
Copy link
Contributor

@gluxon I said that because when you try to run a packaged app from vscode terminal it will not work, dunno the reason but I think it's because vscode has some env var that cause it to crash

@aerben
Copy link

aerben commented Mar 29, 2022

We observed this issue today as well with pkg 5.3.3 wrapping Node 16 for a Ubuntu 20.04 host.
Using the env var
NODE_OPTIONS="--max-old-space-size=4096"

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
@gluxon
Copy link
Author

gluxon commented May 30, 2022

I said that because when you try to run a packaged app from vscode terminal it will not work, dunno the reason but I think it's because vscode has some env var that cause it to crash

Hey @robertsLando, I was looking over this issue again and I realized I forgot to respond. Although VS Code is setting an environment variable that causes it to crash (i.e NODE_OPTIONS), I'd consider it a vercel/pkg bug since I believe vercel/pkg binaries should work in these environments. Please correct me if I'm wrong.

It looks like vercel/pkg-fetch@52d32ed may fix the problem though. Going to check and close this issue if so.

@gluxon
Copy link
Author

gluxon commented May 30, 2022

Confirmed that pkg-fetch 3.4 fixes the problem. 🎉 Thanks @robertsLando and @jesec

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants