0

Essentially what I would like to achieve, is that the stylesheets and scripts receive the correct path. I want to use Hot Reload (npm run hot) for this project so I don't have to use "npm run dev" after every change being made. With that said, the URL helper function actually works to retrieve the path, but that doesn't make me able to hot reload ofcourse.

What I have tried:

Using a nested helper function, for example:

<link href=" {{ url(mix('css/app.css')) }}" rel="stylesheet">

returns: "GET https://localhost:8080/css/app.css net::ERR_BLOCKED_BY_CLIENT"

<link href=" {{ mix(url('css/app.css')) }}" rel="stylesheet">

returns: "GET https://localhost:8080/http://ugly-turkey-88.loca.lt/css/app.css net::ERR_BLOCKED_BY_CLIENT"

Sander Plomp
  • 241
  • 1
  • 4
  • 12
  • Are you not able to just use `mix(...)` i.e. without the `url()` helper? – Rwd Jun 15 '21 at 17:17
  • Returns the same error: GET https://localhost:8080/css/app.css net::ERR_BLOCKED_BY_CLIENT – Sander Plomp Jun 15 '21 at 17:21
  • https://stackoverflow.com/questions/23341765/getting-neterr-blocked-by-client-error-on-some-ajax-calls https://stackoverflow.com/questions/22318119/i-am-getting-failed-to-load-resource-neterr-blocked-by-client-with-google-chr – Rwd Jun 15 '21 at 17:22
  • When disabling my AdBlocker, it changes to: Failed to load resource: net::ERR_SSL_PROTOCOL_ERROR. EDIT: I think I got it working now by not using HTTPS. – Sander Plomp Jun 15 '21 at 17:24
  • Do you have an SSL cert set up for localhost? If not, I would change `https` to `http`. As an alternative to Hot reload, you could use [BrowserSync](https://laravel-mix.com/docs/6.0/browsersync) and `npm run watch`. – Rwd Jun 15 '21 at 17:29
  • 1
    I assume you just need to change the `APP_URL` in .env, so you won't get localhost:8080 – senty Jun 15 '21 at 17:31
  • I already did that, but I used the Allow Origin header in two separate files. Deleted the line in one of the files and now it is working! Thanks for thinking along. – Sander Plomp Jun 15 '21 at 17:38

0 Answers0