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

[v4] Issue with vite-plugin-vue-devtools and v4 beta.1 #15057

Open
HummingMind opened this issue Nov 20, 2024 · 10 comments
Open

[v4] Issue with vite-plugin-vue-devtools and v4 beta.1 #15057

HummingMind opened this issue Nov 20, 2024 · 10 comments

Comments

@HummingMind
Copy link

HummingMind commented Nov 20, 2024

What version of Tailwind CSS are you using?

4.0.0-beta.1

What build tool (or framework if it abstracts the build tool) are you using?

Vite 5.4.11

What version of Node.js are you using?

v22.11.0

What browser are you using?

Chrome 131.0.6778.86

What operating system are you using?

Windows 11 24H2

Reproduction URL

StackBlitz
Can't run it there though. They don't seem to allow plugins like tailwindcss in vite.config.js

image

Another way to reproduce is just to npm create vue@latest with vue router and just add TailwindCSS v4 alpha/beta to it and run the dev server.

Describe your issue

When using vue and vue-router, during vite HMR, the vite-plugin-vue-devtools, version 7.6.4, freaks out with this error:

image

and the page looks like this:

image

@HummingMind HummingMind changed the title [v4] [v4] Issue with vite-plugin-vue-devtools and v4 alpha 34 Nov 21, 2024
@philipp-spiess
Copy link
Member

@HummingMind Hey there! I wasn't able to reproduce this locally using the latest main version of Tailwind CSS (but I don't think we made any Vite changes there before the last release 🤔).

Here's the example I tried: https://github.com/philipp-spiess/tailwindcss-playgrounds/tree/main/vue

It's just a npm create vue@latest like you said with Tailwind CSS v4 installed as a Vite extension and the dev server works just fine (tried to make changes in the .vue and .css files).

@HummingMind
Copy link
Author

@philipp-spiess

I did not give out the full information in the origianl post. It's not just a vue@latest with TW4 and Vue Router. But it's also with unplugin-vue-router, which automatically generates the routes, based on file-based routing, instead of manually configuring them.

I was able to reproduce locally, in a clean create-vue project. I'll use that as the new re-production.

@HummingMind
Copy link
Author

HummingMind commented Nov 22, 2024

@philipp-spiess
Ok, the new reproduction is up. The same link in the original post. I was able to download it and reproduce the problem.

When you run the "dev" script, just go into the /pages/index.vue and just add some tailwind classes to the paragraph element to trigger HMR.

Here is what I see in the client console:

image

@HummingMind HummingMind changed the title [v4] Issue with vite-plugin-vue-devtools and v4 alpha 34 [v4] Issue with vite-plugin-vue-devtools and v4 beta.1 Nov 22, 2024
@HummingMind
Copy link
Author

HummingMind commented Nov 23, 2024

Just noticed that in this error:
image

the path start with /ue-devtools-path and I would think it should be /vue-devtools-path seems like something might be removing the v letter 🤣

If I remove tailwind, when I make css updates, I only see this:
image

So tailwind seems to be triggering different hot updates.

@HummingMind
Copy link
Author

Just tested by switching from the @tailwindcss/vite to the @tailwindcss/postcss and this issue does not happen with the PostCSS plugin.

So it has something to do with the new tailwindcss vite plugin.

Thank you!

@HummingMind
Copy link
Author

Here is what I see in the devtools with the PostCSS plugin, where everything works:

image

@philipp-spiess
Copy link
Member

philipp-spiess commented Nov 25, 2024

Oh I wonder if this is the same issue as #15159 and has to do with virtual modules not being resolved correctly.

Thanks for putting together the repro!

@HummingMind
Copy link
Author

Still happens with beta.3 🍻

@ronarthas
Copy link

Still happens with beta.3 🍻
@HummingMind
I haven't the problem anymore on beta.6

@HummingMind
Copy link
Author

It's much better on beta.6. You can still see "the jump" on the very first window load (once the browser opens), but HMR works fine after that point, where it did not with beta.3. So this could probably be cosnidered "fixed", if there is no way to improve the initial page load.

Thank you for all the hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants