Skip to content

tsconfigPaths behaves not the same as tsc #440

@codeart1st

Description

@codeart1st

Environment

Node.js v22.22.0 - jiti@latest

Reproduction

https://stackblitz.com/edit/vitejs-vite-vzxdmpru?file=tsconfig.json

Describe the bug

  • split tsconfig.json in seperate referenced configs
  • define paths in tsconfig.node.json not in the main tsconfig.json
  • include test.ts file which includes src/test.ts by '@/test'
  • npm run test # tsc -b && JITI_TSCONFIG_PATHS=1 npx -y jiti ./test.ts
  • tsc works - jiti not

Workaround:

  • in main tsconfig.json add "compilerOptions": { "paths": { "@/": ["./src/"] } }
  • now it works in tsc and jiti

Seems to be, that jiti not support references with paths.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions