Maybe you could start sharing some code? Like your @vite() entry point
Duplicate CSS link when using Vite in Laravel
When I look in my app's <head>, some of the <link rel="stylesheet" ...> tags are duplicated. The Blade view contains the first, static occurrence of the tag and then after loading the page the second one is added dynamically. Here's a (cleaned-up) example with additional information:
<!-- These two tags are static in the page source, generated by @vite(...) in a Blade view: -->
<link rel="stylesheet" href="http://localhost/build/assets/VContainer-097126a3.css" nonce="">
<script type="module" src="http://localhost/build/assets/app-950ca430.js" nonce=""></script>
<!-- This gets added dynamically after the page loads: -->
<link rel="stylesheet" href="/build/assets/VContainer-097126a3.css">
The first occurrence gets added because Vite's manifest.json file contains information that there's a dependency between app.js and VContainer.css (app.js imports some CSS, including Vuetify). So far so good.
I can't figure out why the second occurrence gets added. It's causing a problem because the second occurrence gets added after another style (skipped here for brevity) and overrides some of its rules.
I'm not sure how tags are added on the client side, whether that's handled by Laravel or Vite. Any ideas?
Please or to participate in this conversation.