Really happy to see the register/esm appearing. This is brilliant.
I'm using the latest Node LTS 18 and the currently-released 1.6.2.
Using this combo, I receive the following error when passing --loader @swc-node/register/esm on a project -
TypeError [ERR_INVALID_RETURN_PROPERTY_VALUE]: Expected a url string to be returned for the "url" from the "@swc-node/register/esm 'resolve'" function but got instance of String.
at new NodeError (node:internal/errors:399:5)
at ESMLoader.resolve (node:internal/modules/esm/loader:882:15)
at async ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:7)
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:21) {
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE'
Based on the (current) Node loader documentation the return should be something like url: new URL(url).href (using the as-is code)
Really happy to see the register/esm appearing. This is brilliant.
I'm using the latest Node LTS 18 and the currently-released 1.6.2.
Using this combo, I receive the following error when passing
--loader @swc-node/register/esmon a project -Based on the (current) Node loader documentation the return should be something like
url: new URL(url).href(using the as-is code)