unjs/unimport

Wrong path resolution on Nitro or Nuxt

Closed this issue · 0 comments

Environment

  • Operating System: Linux
  • Node Version: v22.4.1
  • Nitro Version: 2.9.7
  • Package Manager: pnpm@9.5.0

Reproduction

https://stackblitz.com/edit/github-ppvihc

Describe the bug

Open the Reproduction provided above and run npm run dev, you will see the error:

[unimport] failed to resolve "/home/projects/github-ppvihc/server/utils/@kikiutils/node/hash", skip scanning

The error originates from the export in server/utils/hash.ts, where the path parsing mistakenly interprets @kikiutils/node/hash as a path under the utils folder. However, the path parsing works correctly for the export in server/utils/string.ts.

Additional context

No response

Logs

No response