Skip to content

Fails to resolve tsconfig.json extends by exports field when using yarn pnp #3698

Closed

Description

@sapphi-red

When a tsconfig.json has extends and that uses exports field to be resolved and using yarn pnp, esbuild fails to resolve the base tsconfig file. The following warning is output.

▲ [WARNING] Cannot find base config file "D:\\path\\to\\project\\packages\\tsconfigs\\config" [tsconfig.json]

    tsconfig.json:2:13:
      2 │   "extends": "tsconfigs/config",
        ╵              ~~~~~~~~~~~~~~~~~~

By running yarn show-config in packages/app, I can see TypeScript resolving it without issue.

If I set nodeLinker: pnpm or nodeLinker: node-modules, esbuild does not output any warnings.

Reproduction: https://github.com/sapphi-red-repros/esbuild-yarn-pnp-tsconfig-extends-exports-field-repro
Original issue: vitejs/vite#16156

Activity

  1. evanw commented on Mar 14, 2024

    @evanw
    Owner

    Thanks for the report. I can reproduce this. Here's a link to this reproduction on esbuild's playground (mostly for myself):

    Playground link

  2. added a commit that references this issue on Mar 14, 2024
    4d997d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions