elastic / elastic/apm-agent-nodejs
improve ESM support
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
**Is your feature request related to a problem? Please describe.**
```
(node:20) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("elastic-apm-node/loader.mjs", pathToFileURL("./"));'
```
`--experimental-loader` is deprecated, and using `--loader` is not recommend
the solution is to create a new file that will register this `loader`
@koa/router instrumentation is not working well with ESM because it uses __dirname, and __dirname does not exist on ESM builds
**Describe the solution you'd like**
improve docs
**Describe alternatives you've considered**
improve docs
**Additional context**
ESM support is lacking
Contributor guide
Assessment
This issue has not been assessed yet.