-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Resolving tsconfig paths breaks inside node_modules #159
Comments
Of course this is arguably an edge case scenario, what I am really struggling with is that I can't add a new test dependency under |
I have this strange behavior:
|
Doesn't sound related to the issue being reported here. Please file a separate issue. |
No, it's the exact same issue. Any file that has |
Elaborating on how your code is breaking (what code? what error?) would add more value to this thread. Right now, it's hard for readers to understand the problem you're experiencing. Does removing those two lines fix it for the reproduction provided? If you feel strongly that it's the same issue, that's fine. But if this gets fixed and doesn't resolve your issue, you'll have to open a new issue. Always better to file earlier so it's on my radar & roadmap. |
The difference in behavior when the parent path contains the string First, my usecase - I'm writing a website generator which is supposed to be installed with npm and run with npx, and to import files from the main package directory. This now breaks my paths configuration if my generator package is properly installed (i.e. not symlinked), because the files that the start script loads are now within a My current development work around is The drawback is that all modules from all packages are now loaded using the same logic specified in the originally used tsconfig. This hasn't broken anything in my project so far, but it has made the load time a tiny bit longer. (Interestingly, it also gave me a warning which found a bug in jsonpath. I must report it after I get some sleep.) I can see two ways of fixing this:
|
Any reason for publishing a non-compiled version to npm that needs a real-time bundler to run? That's very untypical. I believe in your case it makes sense to use e.g. tsup and publish cjs and mjs versions which will start natively. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I'm encountered the same issue. In the above screenshot, the two entry files have exactly the same content, but only the one outside Line 155 in 985bbb8
I haven't studied the source code carefully, but I want to ask what is this line for? Will modifying the logic here help solve this issue? (Actually I can't even find the relavant code in dist, so I have no idea how to test on it.) |
Bug description
I put my project inside
node_modules
directory (not even realnode_modules
alongside somepackage.json
, just a new directory named that).After doing so, resolving tsconfig paths stopped working.
I expect tsx to be agnostic to where the project is located (as long as it has its own
package.json
andtsconfig.json
), same as esbuild is.Reproduction
I repeated this on Stackblitz: https://stackblitz.com/edit/node-qjlxvn
This does not completely resemble the description above (it uses a 'real' node_modules directory) but the very same code can be used to repeat the problem on a completely empty node_modules.
Run:
Environment
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 7.17.0 - /usr/local/bin/npm npmPackages: tsx: ^3.12.1 => 3.12.1
Can you contribute a fix?
The text was updated successfully, but these errors were encountered: