-
Notifications
You must be signed in to change notification settings - Fork 302
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 Support without custom --loader
#3794
Comments
I managed to make the // esm-hooks.js
import { register } from "node:module";
import { pathToFileURL } from "node:url";
register("dd-trace/loader-hook.mjs", pathToFileURL(import.meta.url)); and then |
That is nice, but ideally we wouldn't be using CLI "hacks" to get around this issue. |
I'm not sure how you could do that without ESM hooks tbh |
It's not a hack, it's the official nodejs solution for preloading modules before anything else is the Unfortunately the API hasn't been marked as stable yet, which is one of the reasons the ESM migration for the ecosystem has been such a mess. We're still stuck on CommonJS at my company due to other unrelated ESM bugs. It's amazing it's worked as well as it has thus far for folks. |
From the README:
Is there anywhere we can track these changes or get a sense of the progress towards re-enabling ESM? Given Node docs recommend ESM rather than CommonJS, it's hard to recommend users leverage
dd-trace
.Some likely associated issues:
#3703
#3783
The text was updated successfully, but these errors were encountered: