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

bug: warning message still shows up even with disableExperimentalSEAWarning set to true #107

Open
YassinEldeeb opened this issue Aug 11, 2024 · 5 comments

Comments

@YassinEldeeb
Copy link

Hey,

So, I have this issue, where i see this warning message, which doesn't affect my application logic:

(node:8292) Warning: Currently the require() provided to the main script embedded into single-executable applications only supports loading built-in modules.
To load a module from disk after the single executable application is launched, use require("module").createRequire().
Support for bundled module loading or virtual file systems are under discussions in https://github.com/nodejs/single-executable

Looking at the test bellow, shows that the expected behavior is for this message to only be shown if the disableExperimentalSEAWarning flag is not set to true
https://github.com/nodejs/node/blob/66c807693e6a92ff6429d3890d3fb96ece99b623/test/fixtures/sea.js#L15

But, when looking at the source code, this doesn't seem to be the case, there's no checks for this flag to ignore showing the message if it's set or not.
https://github.com/nodejs/node/blob/66c807693e6a92ff6429d3890d3fb96ece99b623/lib/internal/main/embedding.js#L101

Please let me know if I'm missing something, and how to avoid logging this warning message? Thanks

@joyeecheung
Copy link
Member

joyeecheung commented Aug 16, 2024

This is a separate warning for require()-ing unsupported builtin modules (which means it may or may not work - we have never fully vetted that the builtin that you use works in SEA, your code might happen to work, or it may not, or it may seem to work but it crashes on some input - nobody has checked that module for the SEA use case, so nobody knows for sure).

@FiskPay
Copy link

FiskPay commented Nov 1, 2024

Any update on the matter?

@koooge
Copy link

koooge commented Jan 7, 2025

Hi there, I got this. I understand it's experimental so that's why I set disableExperimentalSEAWarning to true. IMO, the warning should be suppressed. Or please add another option to disable the message.

@mn4367
Copy link

mn4367 commented Jan 23, 2025

I would also strongly advocate making the output of this warning configurable or removing it. I build command line tools with SEA and from the perspective of the user of one of these tools it would be very strange (but rather unacceptable) to see this output every time it is called.

@joyeecheung
Copy link
Member

PRs are welcomed to fix it. It should be reasonably straightforward.

jasnell pushed a commit to nodejs/node that referenced this issue Feb 18, 2025
Signed-off-by: koooge <koooooge@gmail.com>
PR-URL: #57086
Refs: nodejs/single-executable#107
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
acidiney pushed a commit to acidiney/node that referenced this issue Feb 23, 2025
Signed-off-by: koooge <koooooge@gmail.com>
PR-URL: nodejs#57086
Refs: nodejs/single-executable#107
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit to nodejs/node that referenced this issue Feb 24, 2025
Signed-off-by: koooge <koooooge@gmail.com>
PR-URL: #57086
Refs: nodejs/single-executable#107
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
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

No branches or pull requests

5 participants