c12 icon indicating copy to clipboard operation
c12 copied to clipboard

import path resolve error with JITI alias

Open LoTwT opened this issue 2 years ago • 1 comments
trafficstars

Environment

In stackblitz

System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.20.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.4.2 - /usr/local/bin/npm pnpm: 8.6.10 - /usr/local/bin/pnpm

Reproduction

c12-repro

https://stackblitz.com/edit/stackblitz-starters-2bmvpw

jiti-repro

https://stackblitz.com/edit/stackblitz-starters-u9wwgy

steps

  • run node index.js
  • change import methods in the my.config.js

Describe the bug

It has a file whose path is like middlewares/security/index.js.

When loading files by c12 with the JITI alias, it can't resolve path ~middlewares/security which must be ~middlewares/security/index.

But both paths above can work in JITI.

Additional context

No response

Logs

No response

LoTwT avatar Sep 27 '23 07:09 LoTwT