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

[Bug?]: Vite always re-optimises all dependencies when launching dev server #1233

Closed
2 tasks done
Brendonovich opened this issue Jan 9, 2024 · 11 comments
Closed
2 tasks done
Labels
bug Something isn't working vinxi related to vinxi

Comments

@Brendonovich
Copy link
Contributor

Brendonovich commented Jan 9, 2024

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

Running vinxi dev will cause Vite to re-optimise all dependencies, even those that it has previously optimised.

Expected behavior 🤔

Dependencies that were previously optimised shouldn't be re-optimised

Steps to reproduce 🕹

Steps:

  1. Clone https://github.com/brendonovich/macrograph
  2. pnpm install
  3. pnpm web dev and go to http://localhost:4321
  4. Kill pnpm web dev
  5. Repeat steps 3 & 4 a few times
  6. Notice that vite re-optimised deps such as @solid-primitives/* and @koblate/core every time, ignoring caching

Context 🔦

My project has quite a few dependencies to optimise, so this bug makes the dev server's startup time pretty large.

I think this may be a bug in Vinxi, as there's a couple of places (1, 2) where opimtizeDeps is forced.

Your environment 🌎

No response

@Brendonovich Brendonovich added the bug Something isn't working label Jan 9, 2024
@ryansolid ryansolid added the vinxi related to vinxi label Jan 9, 2024
@nksaraf
Copy link
Member

nksaraf commented Jan 15, 2024

those are applied during build. yeah ill have to see whats happening.

@FlatMapIO
Copy link

I think this may be a bug in Vinxi, as there's a couple of places (1, 2) where opimtizeDeps is forced.

Comments force: true Not helpful

@FlatMapIO
Copy link

@nksaraf Is it possible to raise the priority of this issue? I'm using ark-ui and every time I change the browser it shows a 30M js file loaded 😅

@nksaraf
Copy link
Member

nksaraf commented Jan 30, 2024

Yeah I spent some time looking at this and wasn't at first pass able to find where the optimizeDeps is happening again. Ill look again this weekend

@FlatMapIO
Copy link

It seems that all solid libraries have this problem, they all haves source/**/*.jsx in their dist, and for the time being I can only prebuild packages like lucide-solid into a single file, and set the resolve.alias in the vite, otherwise every reload is DDoS'ing the disk! and I have to wait tens of seconds.

@spaaacetoast
Copy link

It seems that all solid libraries have this problem, they all haves source/**/*.jsx in their dist, and for the time being I can only prebuild packages like lucide-solid into a single file, and set the resolve.alias in the vite, otherwise every reload is DDoS'ing the disk! and I have to wait tens of seconds.

Not necessarily related to this issue but the whole package being loaded has more to do with how vite loads kobalte and ark, see this kobalte issue

@birkskyum
Copy link
Contributor

@Brendonovich , the repro is now quite far behind the latest versions of solid-start / vinxi / solid-router. Would you be able to update it?

@FlatMapIO
Copy link

In my experiments, full overloads are rarely (if ever) triggered in 0.6.0, and have little or no impact on the development experience.

@Brendonovich
Copy link
Contributor Author

@birkskyum I've updated all those deps and I'm not getting the optimize deps log anymore, might be fixed now.

@birkskyum
Copy link
Contributor

Excellent, thanks, I'll try the repro again later today and see if I get the same outcome.

@ryansolid
Copy link
Member

Awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vinxi related to vinxi
Projects
None yet
Development

No branches or pull requests

6 participants