node icon indicating copy to clipboard operation
node copied to clipboard

[v18.x] esm: fix `--specifier-resolution=node` not preserving symlinks

Open znewsham opened this issue 1 year ago • 4 comments

Fixes https://github.com/nodejs/node/issues/47649

When you combine --experimental-specifier-resolution=node and --preserve-symlinks imports that were valid in node 14 fail.

While I recognise that this behaviour is experimental, and indeed removed in node 19, swapping to a loader for the simple case of appending .js is quite a bit of effort - even if that effort will eventually need to be made.

znewsham avatar Apr 22 '23 18:04 znewsham

Review requested:

  • [ ] @nodejs/loaders
  • [ ] @nodejs/modules

nodejs-github-bot avatar Apr 22 '23 18:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/51410/

nodejs-github-bot avatar Apr 22 '23 18:04 nodejs-github-bot

Thanks @aduh95 - if you could point me to some of the ESM loader packages that would be great - I did try to roll my own, and it mostly works, but it's not something I'd be comfortable using in production at all really, even once it stops being experimental.

An even better approach would be to just remove all our imports that use ambiguous paths - but that will be an ongoing effort.

znewsham avatar Apr 23 '23 13:04 znewsham

CI: https://ci.nodejs.org/job/node-test-pull-request/51453/

nodejs-github-bot avatar Apr 25 '23 02:04 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/53366/

nodejs-github-bot avatar Aug 16 '23 00:08 nodejs-github-bot

Landed in a00464ee066991caa6f9b406cbf4e77f46791fbf

ruyadorno avatar Aug 17 '23 21:08 ruyadorno