Fix loading JS and CSS assets (ERR_BLOCKED_BY_CLIENT) in Laravel with Vite

Table of contents:

# Watch tutorial

# Solution #1: Change Vite server host

In vite.config.js change Vite server host to localhost:

server: {
    hmr: {
        host: 'localhost',

# Solution #2: Add a custom filter for default Vite host - (for Brave browser)

Go to brave://settings/shields/filters and add a custom filter:


# Why this happens?

It's explained in laravel/vite-plugin repository issues here and here.