JS Snippet hits http://localhost:8000/api/event

Hello folks, I’m trying the self-hosted version of Plausible, something I’ve been waiting for some time already. Thank you Plausible Team for making it possible.

So far everything in the process went smooth, injected the snippet on the site and when I went to create a visit I found the following error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8000/api/event. (Reason: CORS request did not succeed).

I’ve double checked my BASE_URL environment variable and it is correctly set. Is this issue on my side or could it be a bug?

Hey, I haven’t had an issue like this myself. Did you make any changes to the docker-compose.yml file?

Hello! Just checked, my only change to the docker-compose.yml file was the plausible port from 80:8000 to :8000

Just rechecked, seems it was a cache problem. First time I’ve started the docker stack my BASE_URL was set without http:// so it fallback to localhost:8000, when I fixed it the browser still got the old script on cache.

Sorry to waste your time, and thanks again!

Ah, cool. Good to know what the issue was!