Closed arimgibson closed 3 months ago
it seems a bug of experimental-loader. use node --import @swc-node/register/esm-register script.ts
instead as experimental-loader has been deprecated
node --import @swc-node/register/esm-register script.ts
Yep, seems like it works now. Pretty sure I created this issue right when v20 launched and it was still experimental. Or something like that... anyways, thanks @yeliex !
Repro: https://github.com/arimgibson/swc-node-esm-memory-leak
Happens only when running Node v20.0.0 and is almost certainly due to breaking changes for custom ESM loaders introduced in Node v20. Links and context available in repro.
This is the only running Node process, and it can climb higher if given enough time (i.e. increase setTimeout delay)![image](https://user-images.githubusercontent.com/43756494/234729499-3a630550-b419-4207-900c-21a45cf255a3.png)