Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In some cases, using tsconfig.json compilerOptions.paths results in TypeError [Error]: item.test is not a function #1

Closed
panmenghan opened this issue Sep 15, 2024 · 0 comments

Comments

@panmenghan
Copy link

env:

windows 11
node v20.17.0

the reproduction repo:
https://github.com/panmenghan/ts-directly-bug

the steps to reproduce the bug:

$ pnpm i

$ node --import ts-directly/register src/index.ts

node:internal/modules/run_main:129
    triggerUncaughtException(
    ^
TypeError [Error]: item.test is not a function
    at file:///C:/Users/pmh/dev/tmp/ts-directly-bug/node_modules/.pnpm/ts-directly@2.1.1_esbuild@0.23.1_typescript@5.6.2/node_modules/ts-directly/lib/tsconfig.js:71:44
    at Array.find (<anonymous>)
    at getAlias (file:///C:/Users/pmh/dev/tmp/ts-directly-bug/node_modules/.pnpm/ts-directly@2.1.1_esbuild@0.23.1_typescript@5.6.2/node_modules/ts-directly/lib/tsconfig.js:71:26)
    at async resolve (file:///C:/Users/pmh/dev/tmp/ts-directly-bug/node_modules/.pnpm/ts-directly@2.1.1_esbuild@0.23.1_typescript@5.6.2/node_modules/ts-directly/lib/loader.js:76:19)
    at async nextResolve (node:internal/modules/esm/hooks:866:22)
    at async Hooks.resolve (node:internal/modules/esm/hooks:304:24)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18)

I also tested with tsx using tsx src/index.ts, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant