-
Notifications
You must be signed in to change notification settings - Fork 30k
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
workers: --require module injects module to worker thread #28518
Comments
cc @addaleax |
i wouldn't expect this to happen, but it's not exactly a leap to want this behaviour either... maybe we can add a flag to workers to disallow loading these (default enabled) |
Just noting that both |
Is this really not expected? This seems to me as if it would be working as intended. |
The documentation is, unfortunately, not very clear about side-effects: https://nodejs.org/dist/latest-v12.x/docs/api/cli.html#cli_r_require_module |
From the
So, yes, inheriting CLI flags is intentional, and there is a way to override this, and I would say that this seems like a documentation visibility issue than a bug? |
Should we split process-only options (e.g., In my use case I am not controlling spawning workers or creating child processes, so I can not override it. I can workaround it on my side by checking for worker in required module but I prefer |
Steps to reproduce:
and b.js:
node --require b.js a.js
I am wondering is it feature or bug that we inject
--require
module to workers. If it is feature, should we mention it in workers doc and in--require
flag description?In my use case - I use
--require
to implementinspector
socket discovery in user land - I need--require
only for main thread. I can workaround it on my side but do we need some additional flag that will inject to workers instead of reusing existing flag.The text was updated successfully, but these errors were encountered: