question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Laravel plugin keeps full refreshing the page when refresh is disabled

See original GitHub issue
  • Laravel Vite Plugin Version: 0.5.2
  • Laravel Version: 9.19.0
  • Node Version: 16.15.0
  • NPM Version: 8.11.0
  • Host operating system: Linux
  • Web Browser & Version: Chrome 103.0.5060.134
  • Running in Sail / Docker: Docker

Description:

It seems that setting refresh: false doesn’t disable full reloads on blade files changes

Steps To Reproduce:

this is my vite.config.js

import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    server: {
        host: '0.0.0.0',
        port: 3000,
    },
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
            ],
            refresh: false,
        })
    ],
});

and this is the result if I change one of my blade files:

https://user-images.githubusercontent.com/8792274/182189388-7cbde9b6-64f3-4cc2-9c56-e2d0ea10e841.mp4

am I missing something in the configuration?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
jessarchercommented, Aug 2, 2022

Hey @fabio-ivona, thanks for reporting this.

I’ve been able to replicate the issue starting from version 0.5.0 onward when we switched to Vite 3.

I’ll see if I can figure out what’s going on.

0reactions
fabio-ivonacommented, Aug 9, 2022

I agree with that behavior if you want to make it work with a plain html + tailwind:

If i add a tailwind class inside my html, the css is updated with the new rule, but I need to refresh the page to add the class to the html

Also, I agree with them that there should be a way to override the default behavior (i.e. for livewire components), but I think it is a vite related issue

The main issue is that it could be counterintuitive setting refresh=false here and experience a full reload when html is changed

It could be overridden with a fix similar to the one I made on the livewire plugin, but we should coordinate in order to overlap each other with the fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel keeps reloading the page after redirect - Stack Overflow
I was using Live Server extension from VS Code to auto refresh the page. This extension was reloading the page again and again...
Read more >
How to refresh a page in laravel after saving data? - Laracasts
After saving data to database i want to refresh the page. How to do this in laravel controller?
Read more >
Refresh a page using PHP - GeeksforGeeks
Use header() function to refresh a web page in PHP. ... Note: This function prevents more than one header to be sent at...
Read more >
Submit a Form Without Page Refresh Using jQuery - Code
A great way to improve the user experience of your website is to validate and submit forms without a page refresh.
Read more >
How to Make a Modal Popup Refresh Items on the Page
Modal popups are a great way to manage content on the page and attract attention to specific features of an app.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found