Open yeskunall opened 1 week ago
@yeskunall, this is not related to Fly.io. The problem is, that the static asset/tracker script script.js
is served by the Next.js server without an Access-Control-Allow-Origin
header.
This itself is fine, as the header is not needed when a browser is instructed to load the script via a script
tag. But, the header is required when the script is programmatically fetched via XmlHttpRequest
or fetch
.
As Partytown uses fetch
inside the web worker to get the tracking script, the header Access-Control-Allow-Origin
header is necessary in order to make Umami work with Partytown.
The header can easily be added for the tracker script. I tried it locally. Umami then correctly works with Partytown.
I will create a PR to suggest the change. 🙂
To sum it up and avoid any confusion: In my opinion, this issue is more about supporting Partytown in general.
Describe the Bug
The expected header
Access-Control-Allow-Origin
is not set when deploying to Fly.io using the guides. As a result, we can‘t use it with Partytown, which requires the header to be set.Database
PostgreSQL
Relevant log output
No response
Which Umami version are you using? (if relevant)
v2.13.2
Which browser are you using? (if relevant)
Brave
How are you deploying your application? (if relevant)
Fly.io