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

checkDevServer config setting not working as expected when using Vite 3 #37

Closed
kylecotter opened this issue Jul 14, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@kylecotter
Copy link

Describe the bug

The checkDevServer config setting when set to true is not having the desired effect when using it with Vite 3. Currently, when running the Vite dev server, this config setting needs to be false or not set for any assets to generate.

Similar comment here but splitting out into its own ticket.

To reproduce

Steps to reproduce the behaviour:

  1. Set checkDevServer to true in config/vite.php
  2. Run vite command
  3. In browser, no js/css assets are injected

Expected behaviour

Previous functionality with Vite 2 exists where you can set the checkDevServer setting and have the Vite Craft plugin determine whether to inject assets or read from a manifest file based on the dev server running or not.

Versions

  • Plugin version: 4.0.1
  • Craft version: 4.1.4.1
  • Vite version: 3.0

Thanks!

@kylecotter kylecotter added the bug Something isn't working label Jul 14, 2022
@khalwat
Copy link
Contributor

khalwat commented Jul 14, 2022

On vacation at the moment, so have done nothing to vette this with Vite 3 yet.

Let me know if you find any info on how they are recommending you check for the devServer running in Vite 3.

@jalendport
Copy link

Looked into this briefly because I'd love to move to Vite 3 soon-ish, but will probably wait until a couple point releases come out and things are more settled 😅

Anyway, I didn't find a solution, but here are some PRs for future reference that had a direct bearing on the change:

@khalwat
Copy link
Contributor

khalwat commented Jul 14, 2022

Looks like this might be the way: https://github.com/vitejs/vite/pull/6819/files

So just try the raw dev server, and if I get a 400 it's running, and if it just can't connect at all, it isn't.

khalwat added a commit to nystudio107/craft-plugin-vite that referenced this issue Jul 16, 2022
…ecause they removed the intercepting of `__vite_ping` ([#37](nystudio107/craft-vite#37))
khalwat added a commit to nystudio107/craft-plugin-vite that referenced this issue Jul 16, 2022
…ecause they removed the intercepting of `__vite_ping` ([#37](nystudio107/craft-vite#37))
@khalwat
Copy link
Contributor

khalwat commented Jul 16, 2022

Addressed in:

Craft 3: Version 1.0.27 -> https://github.com/nystudio107/craft-vite/releases/tag/1.0.27

Craft 4: Version 4.0.2 -> https://github.com/nystudio107/craft-vite/releases/tag/4.0.2

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

No branches or pull requests

3 participants