Bug Description
I tried to update to a custom tracking script name, the script loads, but then does work beyond that.
Steps to Reproduce
- Set a custom tracking script name
- Deploy Counterscale
- Update
counterscale-script src
- Errors in the console
Expected Behavior
Counterscale works as it does normally without a custom script name
Actual Behavior
I was getting a CORS error:
Access to XMLHttpRequest at 'https://counterscale.joshdales.dev/counter.js?sid=joshdales.dev' from origin 'https://joshdales.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
However that was kinda a red herring, I think that the issue is here: https://github.com/benvinegar/counterscale/blob/main/packages/tracker/src/tracker.ts#L36 where tracker.js is hardcoded to be replaced rather than using the custom script name.
Component
@counterscale/tracker
Environment
- OS: Mac
- Browser: Chrome
- Counterscale version: 3.4.1
Additional Context
Solved the issue for now by removing the custom script name
Bug Description
I tried to update to a custom tracking script name, the script loads, but then does work beyond that.
Steps to Reproduce
counterscale-scriptsrcExpected Behavior
Counterscale works as it does normally without a custom script name
Actual Behavior
I was getting a CORS error:
However that was kinda a red herring, I think that the issue is here: https://github.com/benvinegar/counterscale/blob/main/packages/tracker/src/tracker.ts#L36 where
tracker.jsis hardcoded to be replaced rather than using the custom script name.Component
@counterscale/tracker
Environment
Additional Context
Solved the issue for now by removing the custom script name