unjs / jiti

Runtime TypeScript and ESM support for Node.js
MIT License
1.91k stars 62 forks source link

fix(types): `RequireExtensions`, `Module` and `Dict` not available #315

Closed dargmuesli closed 1 month ago

dargmuesli commented 1 month ago

Environment

node: v22.9.0 typescript: v5.6.2 jiti: v2.1.0 tsconfig.json:

{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "target": "ESNext"
  }
}

Reproduction

https://github.com/dargmuesli/jonas-thelemann/actions/runs/11146377845/job/30978230785?pr=466#step:7:566

Describe the bug

In https://github.com/unjs/jiti/commit/31228096175d82e1983744708735c3b5145f0658#diff-8c7afc404615bae694369f29084da8dfe0c52457350e597271b2a733a7ea0d7cR18 RequireExtensions, Module and Dict were added but they are not available with the tsconfig.json given above. What needs to change?

dargmuesli commented 1 month ago

So the types come from @types/node but somehow they are not resolved properly. I added @types/node to my project, but this didn't change the outcome.

dargmuesli commented 1 month ago

@pi0 still Module is not found: https://github.com/dargmuesli/creal/actions/runs/11159598248/job/31018323683?pr=495#step:7:550

pi0 commented 1 month ago

Ah! I hope https://github.com/unjs/jiti/releases/tag/v2.1.2 this fixes

dargmuesli commented 1 month ago

It did, perfect!