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

build fails with stack overflow error when resolving root tsconfig.json extends #3915

Closed
sapphi-red opened this issue Sep 17, 2024 · 1 comment

Comments

@sapphi-red
Copy link
Contributor

Running esbuild ./input.ts in a workspace matching the following conditions fails with stack overflow error:

  • The monorepo contains a root-level tsconfig.json.
  • That root-level tsconfig.json extends a shared tsconfig.json.
  • The shared tsconfig.json is exposed via the package.json exports field.
  • The workspace has an independent tsconfig.json of its own

Notes

  • workspace-level tsconfig.json files extending one of the shared configs work fine. The issue does not arise until there is a root tsconfig.json and a workspace tsconfig.json.
  • I have not tested if using a relative extends (example: ../../tsconfig.json) resolves the issue

Reproduction

  1. Clone https://github.com/sapphi-red-repros/esbuild-tsconfig-extends-repro
  2. yarn install
  3. yarn build
  4. Error happens

Additional info

If the extends in the root tsconfig.json is removed, no error happens.
If exports is removed from the tsconfigs package and "extends": "tsconfigs/configs/tsconfig.json", is used instead for the tsconfig.json in vite-demo package and the root tsconfig.json, no error happens.

Original issue: vitejs/vite#18094

@evanw
Copy link
Owner

evanw commented Sep 17, 2024

Thanks for the report. I can reproduce this. Here is a link to the reproduction.

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

2 participants