New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Js and Css assets are not loading - ERR_BLOCKED_BY_CLIENT / Referrer Policy: strict-origin-when-cross-origin #47
Comments
@timacdonald I added that to my vite.config.js and it did not resolve the issue. I'm visiting the Valet URL and it is requesting assets via https://localhost:3000/ and throwing a strict-origin-when-cross-origin / GET https://localhost:3000/resources/css/app.css net::ERR_BLOCKED_BY_CLIENT error. Here is my vite.config.js
|
@fylzero we are gonna look into this for you today. I misread the issue initially I'm sorry. |
@timacdonald No problem, thanks for assisting. Not sure this is necessarily an issue with the plugin but I ran into this with two apps so I'd like to know what is causing it. Excited to switch these to Vite. |
I've also walked through the documentation and moved my CSS import to javascript and replaced my resolve/require statement with resolvePageComponent. Still having the same resulting error on my javascript. strict-origin-when-cross-origin / ERR_BLOCKED_BY_CLIENT |
Hey @fylzero, we've tried to replicate this but haven't been able to locally. Are you able to create a new Laravel project and replicate the issue? If so, could you do that and create a GitHub repository that we could pull down and test. A few other things that might be useful to know:
|
The repo I'm attempting this on is public: https://github.com/fylzero/simran-hates-meetings - The Shift branch is
|
haha. I hate meetings as well 🤣 |
@timacdonald We started this a couple years ago. No one loves this project more than the person we joke about with this. Also, this is my favorite app to try bleeding edge things on, so this is perfect! 😂 |
Because I can tell how extremely critical this application is, I sent through a PR which makes the final tweaks to work with Vite. I believe it was just a few missing steps and the fact that Vite doesn't give great errors that this was a problem |
If it is still an issues after you merge and have a play, please let us know. |
@timacdonald Oh man! Excellent shirt! I hope you've seen "Unbearable Weight of Massive Talent" (very much worth seeing). We actually have a Cage club at work and watch all his movies together and have meetings (on company time) to discuss. UGH! So, I merged your PR into the shift-64898 branch. Pulled the changes. I'm still getting the same blank page/error. 😭 I did composer dump-autoload, composer update, npm update, npm run dev. Same 💩 sadly. Any other thoughts on this? Sorry to be a pest. |
That is gold! I have seen it - loved the movie heaps!!! |
let me test some more. |
@fylzero can you test in Firefox and confirm the issue exists there as well on your machine? |
ahhh, i think I can replicate the issue now @fylzero |
@timacdonald It happens in FF as well. |
Looks like the browser thinks Vite is a ad or something. I can replicate the issue and fix the issue by turning off the shields up stuff. Might need to put localhost on an allow list or something to make this work permanently. Let me know if that works for you. Screen.Recording.2022-07-01.at.4.22.58.pm.mov |
@timacdonald That gets me a little further! Weird it is saying the site is "not secure" when doing that. I can try to dig into that. Thanks again for your help! |
no troubles. Hope you enjoy Vite once you get it kicking smoothly on your end! |
@timacdonald I'm still struggling with this but have a little more information. I tried installing a fresh copy of Laravel (composer global version and packages are up to date), running Valet (Valet is working for other apps), installed Jetstream w/ Inertia (no teams), and I'm still getting this error with no interface loading / blocked assets. This issue is only occurring on my personal machine, not on my work machine... so something is wonky on this system. Might have to just burn my OS to the ground and start fresh. I can't think of what would cause this. Maybe it's time I switch from Valet to Sail. idk Update: Oh wow! Even running Sail I get the same error. Update update: Didn't realize I was not running Brave on my work machine and this stopped presenting as an issue in FF on my personal machine. So I guess the bottom line is this is weirdness with Brave and the Vite setup. That's at least super useful to know! |
Thanks for the update @fylzero. Seems like Brave might really bring the hammer down on cross domain stuff. I'm gonna try and put some time aside to dig deeper on what we can do to make Brave play nicer with things. |
@fylzero I've spent some time on this today and from what I can see, this is a problem in Brave and it is just how it works. However, you can do the following.
Open
but replacing This rule could probably be improved to allow on all |
I had to replace |
In my case (using Vite 3.1.8), the resource URLs are under
According to the docs, multiple domains can be specified using | as the separator, so you could do something like:
Or, just specifying a domain of
|
Had Ad blocker installed apperently it was causing the site not to load the source files, use another browser and see if it works. |
In case you haven't found it already, in Brave, you should check the URL form and click on the circled Brave ad button, as shown in screenshot. In the modal, turn the switch off. This removes the ERR_BLOCKED_BY_CLIENT error for Vite and normally, Vite works as usual. You have to make it once for each new URL you use. |
@timacdonald, This seems to work well on all my valet parked .test domains...
PS. @Tedderouni, I'm confused what your |
This is what I added in the adblock filter and it works for all sites in .test |
I am having this very same problem GET http://[::1]:5173/@vite/client net::ERR_BLOCKED_BY_CLIENT. I guess if there were a way to configure (I don't know where) vite to know the schema the app is under. I mean locally it runs http and live it runs https. I've tried some recommendations: |
@rick-nataniel-walker you should not be running the dev server in production. You need to:
If you see references to |
Thanks @timacdonald,
|
Description:
Ran VIte shift on a couple small applications and both apps are not loading the front end (just a blank white page). app.css and app.js are not loading due to ERR_BLOCKED_BY_CLIENT / Referrer Policy: strict-origin-when-cross-origin. Also worth noting I am running Valet to serve locally.
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: