-
Notifications
You must be signed in to change notification settings - Fork 284
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
ESM loader v20.3.0 access parent path #4190
Comments
Are you perhaps looking for |
This would work too, but it is undefined for the first entry.
In general I am looking for a solution without using the hooks. |
Pass it to the loader via the |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
Details
Hi there!
In Node v18 the loader was able to easily access all cmd line args via
process.argv
.loader.mjs
But with the off-thread change, the
process.argv
are no longer complete.The second entry is missing. The path to the app is missing.
I found a workaround, but I am not really happy with it. Wondering if there is an easier way.
When using the resolver hook, it is possible to get the parent path.
loader.mjs
This is important for APM tools, because we auto-load a tracer tool inside the loader to monitor an app. And we need access to the app path.
Node.js version
v20.3.0
Example code
See above.
Operating system
darwin
Scope
See above.
Module and version
Not applicable.
The text was updated successfully, but these errors were encountered: