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.

Vite is refreshing always in windows

See original GitHub issue
  • Laravel Version: 9.27.0
  • PHP Version: 8.1.2
  • Database Driver & Version: NA
  • OS: Windows 11, execute directly (no docker, no sail, no WSL)

Description:

When using refresh: false in vite.config.js, the browser is still hot reloaded as soon as a file is saved.

Steps To Reproduce:

Using this vite.config.js config file, execute npm run dev and serve to see the website in the browser. Make a change in a file, save, and the browser is reloaded, although there is refresh: false in the config file.

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: false,
        }),
    ],
});

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
timacdonaldcommented, Sep 5, 2022

This behaviour is expected and is not introduced by the Laravel plugin.

See: https://github.com/vitejs/vite/issues/9512#issuecomment-1208133617

Vite has to do a refresh as there are circular dependencies when using Tailwind.

0reactions
timacdonaldcommented, Sep 5, 2022

no troubles

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vite keeps refreshing the page with logs stuck in `connecting`
I've had to define host where vite is running, because by default it's taken from window.location.hostname , so that's why it never connects....
Read more >
Troubleshooting - Vite
Vite cannot handle and does not support code that only runs on non-strict mode (sloppy mode). This is because Vite uses ESM and...
Read more >
Vite.js (Vue): Unwanted Page Reload Happens Only On ...
It seems Samsung Internet browser disallows insecure websockets. A workaround is to enable HTTPS in Vite with server.https , so that it ...
Read more >
Automatic reload | Guide - Vite PWA - Netlify
Automatic reload #. With this behavior, once the browser detects a new version of your application, then, it will update the caches and...
Read more >
Fixing the 'cannot GET /URL' error on refresh with React ...
In this post you'll learn how to fix the 'cannot GET /URL' error with React Router. Along the way, you'll also learn how...
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