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

updated tsconfck package causes qwik build to fail when tsconfig is used with "references" #15870

Closed
7 tasks done
dmitry-stepanenko opened this issue Feb 11, 2024 · 2 comments
Closed
7 tasks done

Comments

@dmitry-stepanenko
Copy link

Describe the bug

I debugged the vite bundle locally and looks like a bump of tsconfck package from 3.0.1 to 3.0.2 causes a failure in qwik apps with multiple tsconfigs.

In my setup I use tsconfig.json along with tsconfig.spec.json and tsconfig.app.json. Basically, tsconfig.json has "references": [{"path": "tsconfig.spec.json"}] in it.

Before the recent update everything was working fine. See steps to reproduce below for additional details

I propose reverting the tsconfck bump until the reason of this regression is fixed

Reproduction

https://github.com/dmitry-stepanenko/qwik-vite-tsconfck-bump-error

Steps to reproduce

To reproduce a regression with tsconfck bump from 3.0.1 to 3.0.2, pull the repo referenced above

  1. Run npm run build.client and notice an error
  2. Run npm run revert-tsconfck-changes that will patch vite's chunk to revert the tsconfck package bump (see patches/vite+5.1.1.patch for the patch diff)
  3. Run npm run build.client and notice everything builds fine
  4. Try running rm -rf node_modules/vite && npm i && npm run build.client, you'll see the error is back

To reproduce the bug from scratch:

  1. Run npm create qwik@latest (getting v1.4.4 as of now with vite@5.1.1)
  2. Run npm run build.client and see everything is ok
  3. Add "references": [{"path": "tsconfig.spec.json"}], to the tsconfig.json
  4. Run echo '{ "extends": "./tsconfig.json" }' > tsconfig.spec.json (a simple tsconfig file without any configurations)
  5. Run npm run build.client, you'll get silent exit
  6. Comment out tsconfigPaths in vite.config.ts (now you have only plugins: [qwikCity(), qwikVite()],)
  7. Run npm run build.client and see an error
  8. Install "vite": "5.1.0-beta.7" and try building again, everything is ok this time

Upon further debugging I discarded changes related to tsconfck in node_modules/vite/dist/node/chunks/dep-G1t0FnMB.js (chunk name might be different depending on the vite version) and can confirm it addresses the problem

System Info

System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 69.37 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
    pnpm: 8.14.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 121.0.6167.160
    Safari: 14.0
  npmPackages:
    vite: 5.1.0-beta.7 => 5.1.0-beta.7

Used Package Manager

npm

Logs

No response

Validations

@dmitry-stepanenko
Copy link
Author

Related dominikg/tsconfck#154

@sapphi-red
Copy link
Member

Closing as #16124 is merged (released in 5.1.6).

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants