I solved it by removing public/hot file, and running npm install && npm run build
Aug 13, 2024
4
Level 3
Vite showing [::1]:5173 url in production, the page has no styling at all
I don't know what went wrong, the site was working fine, I left for an hour and came back to see all my styling disappeared.
I'm using @vite(['resources/css/app.css', 'resources/js/app.js']) to include the files,
but on the website, network tab shows 3 failed requests to these URLs :
http://[::1]:5173/@vite/client
http://[::1]:5173/resources/css/app.css
http://[::1]:5173/resources/js/app.js
my vite.config.js file was like this (default) :
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
});
Chatgpt told me to change it to this :
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
build: {
manifest: true, // Generates a manifest file for Laravel to use
outDir: 'public/build', // Output directory for production assets
rollupOptions: {
output: {
entryFileNames: 'assets/[name].js',
chunkFileNames: 'assets/[name].js',
assetFileNames: 'assets/[name].[ext]',
},
},
},
});
it didn't work either. And I've done route, view, cache clear and npm run build like a billion times.
Site url in case you want to see it yourself : teknot.com.tr
Level 3
11 likes
Please or to participate in this conversation.