-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
tsconfig paths not resolving in imported package #76
Comments
This is expected behavior. A TypeScript compilation—which is happening at runtime in this case—, cannot load more than one I verified that tsx's behavior is consistent with |
@privatenumber But this is not consistent with esbuild itself! In the reproduction repo:
So it's possible to build a production build with these aliases but not run it in dev mode with |
@privatenumber thoughts? |
Curious how esbuild works if setting a different tsconfig path? |
@privatenumber esbuild supports multiple tsconfig.json from referenced folders - same as I would expect from tsx. This is explicitly stated by Evan, e.g.:
|
How does it handle custom e.g. If project A uses |
I'm not following how is that related to the case. From what I've quickly gathered, there's no esbuild API option to provide different custom named tsconfig's for different projects. Why would that matter? |
In case the uncompiled dependency project has a custom tsconfig (eg. with I'm going to lock this thread in favor of #96 since this one is already closed. |
Bug description
I have a monorepo with two packages
a
andb
. I run a script in packagea
which imports a module from packageb
. The module in packageb
imports a submodule from packageb
using tsconfig paths.I expect the script to run normally.
Instead, it crashes:
Reproduction
https://github.com/IlyaSemenov/tsx-monorepo-import-reproduction includes step by step reproduction.
By the way, if you run
pnpm add esbuild-runner
and run the script withpnpm esr test.ts
, it will work! (esbuild-runner is unfortunately abandoned and has other issues)Environment
Can you contribute a fix?
The text was updated successfully, but these errors were encountered: