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
- # Solution #2: Add a custom filter for default Vite host - 0.0.0.0 (for Brave browser)
- # Why this happens?
# 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 - 0.0.0.0 (for Brave browser)
Go to brave://settings/shields/filters
and add a custom filter:
@@||0.0.0.0
# Why this happens?
It's explained in laravel/vite-plugin
repository issues here and here.