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

Vite unable to find base tsconfig in a yarn monorepo #16156

Closed
7 tasks done
bskinner opened this issue Mar 13, 2024 · 4 comments
Closed
7 tasks done

Vite unable to find base tsconfig in a yarn monorepo #16156

bskinner opened this issue Mar 13, 2024 · 4 comments
Labels
bug: upstream Bug in a dependency of Vite p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@bskinner
Copy link

bskinner commented Mar 13, 2024

Describe the bug

I'm using a Yarn monorepo for a project, and I have share tsconfig files located in a separate package within the monorepo. When running vite or vite build, vite will be unable to resolve the base configuration and prints the following message (<path-to> is not literally printed, but is a stand-in for the actual path on my filesystem):

[WARNING] Cannot find base config file "/<path-to>/tsconfig-locate-repo/packages/tsconfigs/config" [tsconfig.json]

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

Both Typescript (tsc) and VSCode are able to successfully resolve the location of the base config, and do not display any warnings or errors about not being able to resolve the config file.

Switching the nodeLinker mode in the .yarnrc.yml file from pnp to node-modules allows for the base config to successfully be found and results in the correct behavior.

Expected Behavior

The path to the base config should be properly resolved, and a warning should not be printed.

Actual Behavior

The base configuration can not be resolved and Vite completes it's operation without including the settings in the extended configuration.

Reproduction

https://github.com/bskinner/tsconfig-locate-repro

Steps to reproduce

Run yarn then run either yarn workspace vite-demo build or yarn workspace vite-demo serve (both will show the warning)

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-1245U
    Memory: 13.54 GB / 15.62 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 20.10.0 - /tmp/xfs-1b4eff7a/node
    Yarn: 4.1.1 - /tmp/xfs-1b4eff7a/yarn
    npm: 10.2.3 - ~/.nodenv/versions/20.10.0/bin/npm

Used Package Manager

yarn

Logs

No response

Validations

@sapphi-red
Copy link
Member

This seems to be a bug in esbuild: evanw/esbuild#3698

@sapphi-red sapphi-red added bug: upstream Bug in a dependency of Vite p2-edge-case Bug, but has workaround or limited in scope (priority) labels Mar 14, 2024
@bskinner
Copy link
Author

Thank you for the update!

@sapphi-red
Copy link
Member

It was fixed in esbuild 0.20.2 so it will be fixed in Vite 5.2.

@bskinner
Copy link
Author

Much appreciated. I checked the example included with my original issue using vite 5.2.0-beta.1 & esbuild 0.20.2 and all looks good.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

No branches or pull requests

2 participants