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

Import resolves to local file instead of node module #209

Open
andrejleitner opened this issue Apr 26, 2022 · 4 comments
Open

Import resolves to local file instead of node module #209

andrejleitner opened this issue Apr 26, 2022 · 4 comments

Comments

@andrejleitner
Copy link

Originally filed on ts-node, but the problem seems to be related to tsconfig-paths, detailed info: TypeStrong/ts-node#1732

This seems to be related: https://stackoverflow.com/questions/66329553/ts-node-requires-newrelic-js-instead-of-node-module

@andrejleitner
Copy link
Author

cc: @jonaskello

@shigma
Copy link

shigma commented May 14, 2022

I had the same problem.

tsconfig-paths was supposed to read node_modules but instead read local files, even though it wasn't declared in tsconfig's paths.

@Alex0007
Copy link

Alex0007 commented Jun 24, 2022

@jonaskello

I have this issue as well.

If there is a local file at the root with name matching to one of node_modules, then that file completely replaces module in imports (and this breaks things)

@kof
Copy link

kof commented Jul 7, 2022

Hey, we just stumbled over this and realized tsconfig-paths isn't using node's path resolution algorithm which breaks the system for a monorepo setup.

This line needs to use path.resolve https://github.com/dividab/tsconfig-paths/blob/master/src/tsconfig-loader.ts#L144

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

4 participants