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

Multiple tsconfigs used when building a workspace with aliases #3375

Closed
ilijapuaca opened this issue Sep 11, 2023 · 3 comments
Closed

Multiple tsconfigs used when building a workspace with aliases #3375

ilijapuaca opened this issue Sep 11, 2023 · 3 comments
Labels

Comments

@ilijapuaca
Copy link

This seems to be a regression (or a change in behavior) starting with v0.19 - our builds started failing after the upgrade with errors indicating that paths for one of the aliases was not being resolved correctly. After spending some time going through the verbose log, it turned out that the issue happens because tsconfig of the aliased package seems to come into the play when previously that supposedly wasn't the case.

Putting a small repro in place seems difficult as yarn workspace setup may be involved as well at some point. We basically have a git submodule in our workspace that has a somewhat complicated setup by itself that we set up aliases to in our own codebase, hence the presence of tsconfig in the module itself.

Previously aliases were picked up just fine, but after upgrading to v0.19 builds fail as wrong files (not the ones that paths points to) get picked up. After removing tsconfig.json out of the aliased package things seem to work fine again, so my assumption is that that the tsconfig that's present in the submodule is somehow taken into account now while transpiling its code (although it has nothing to do with the initial entry point) where it previously wasn't.

I've put together this setup which is the closest I can get to modeling a similar setup without having to put together an entire repo with yarn, which I'll do if need be, but I thought it'd be worthwhile putting this up first as someone might have an idea what the regression/change might've been here.

@ZuBB
Copy link

ZuBB commented Sep 12, 2023

It sounds similar to what is described in #3354

@evanw evanw added the tsconfig label Sep 14, 2023
@ilijapuaca
Copy link
Author

Perhaps worth noting - the submodule which contains tsconfig that previously wasn't being taken into account has paths set to such:

  "paths": {
      "*": ["*"]
    }

Removing this makes things work the way they have < 0.19 🤷‍♂️

@evanw
Copy link
Owner

evanw commented Oct 17, 2023

I just fixed #3354 and I'm closing this issue under the assumption that it's a duplicate.

I'm not sure what the link in the original post is trying to demonstrate as everything appears to be working fine to me and esbuild's behavior is not different between 0.18.x and 0.19.x on that code. So I can't currently reproduce what this post is describing.

@evanw evanw closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants