scorecard-webapp icon indicating copy to clipboard operation
scorecard-webapp copied to clipboard

Goat counter issue on staging branch

Open mdunbavan opened this issue 2 years ago • 4 comments

Hello all,

So after a bit of investigation it seems like Google App Engine has some issues with external scripts being loaded on static sites that are client-side only. I got to this conclusion by deploying exactly the same code to Netlify to see if I could replicate the issue there but it worked perfectly fine for me. The url is below:

https://staging-netlify-test--elastic-noether-393172.netlify.app/

I then changed the above env to use SSR(server side rendering) on the front-end so we aren't relying too much on the client-side and we get the added benefits of everything being loaded into the app state at once. This would then stop the issue of the external script being loaded before the client-side was ready breaking the site on refresh.

To further back up my thoughts, I have attached a screengrab of the associated env with the network tab open displaying the Goatcounter script publishing a count event.

Screenshot 2022-04-13 at 12 03 06

I have now created a PR to go into the main branch for staging on Google App Engine with the same config settings as above. I will need this to be approved to merge into main then we can further test.

https://github.com/ossf/scorecard-webapp/pull/74

Thanks, Mark

mdunbavan avatar Apr 13 '22 10:04 mdunbavan