Closed KnisterPeter closed 1 month ago
Describe the bug In a runtime environment with --experimental-import-meta-resolve enabled, the module loader fails and does not resolve correctly.
--experimental-import-meta-resolve
To Reproduce Steps to reproduce the behavior:
import.meta.resolve
node --experimental-import-meta-resolve --import ts-blank-space/register ./path/to/program.ts
The program/loader fails with the following error:
> node --import ts-blank-space/register --experimental-import-meta-resolve ./src/index.ts "./src/index.ts" node:internal/modules/run_main:123 triggerUncaughtException( ^ TypeError [Error]: Invalid URL at Object.getPackageScopeConfig (node:internal/modules/package_json_reader:132:33) at packageResolve (node:internal/modules/esm/resolve:792:43) at moduleResolve (node:internal/modules/esm/resolve:908:18) at defaultResolve (node:internal/modules/esm/resolve:1038:11) at nextResolve (node:internal/modules/esm/hooks:748:28) at resolve (file:///xxx/node_modules/.pnpm/ts-blank-space@0.4.1/node_modules/ts-blank-space/loader/hooks.js:7:22) at nextResolve (node:internal/modules/esm/hooks:748:28) at Hooks.resolve (node:internal/modules/esm/hooks:240:30) at MessagePort.handleMessage (node:internal/modules/esm/worker:199:24) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20) { code: 'ERR_INVALID_URL', input: 'input.ts' } Node.js v22.8.0
Expected behavior It should be able to resolve the required module.
Environment (please complete the following information):
Without --experimental-import-meta-resolve it does work, but not resolves relative to the parent. That is expected and not an issue with the loader.
I guess it's me holding it wrong. 😄
Describe the bug In a runtime environment with
--experimental-import-meta-resolve
enabled, the module loader fails and does not resolve correctly.To Reproduce Steps to reproduce the behavior:
import.meta.resolve
to resolve a module.node --experimental-import-meta-resolve --import ts-blank-space/register ./path/to/program.ts
.The program/loader fails with the following error:
Expected behavior It should be able to resolve the required module.
Environment (please complete the following information):