Old version of web-vitals.js in production
rviscomi opened this issue · comments
Despite our package.json being up to date on version 3.5.2, web-vitals.js in production has stale code:
It's missing the firstEntryWithTarget
fix for INP attribution:
I noticed this while debugging INP in production and seeing discrepancies between the Web Vitals extension (which is actually on 3.5.2) and the script we're using for our RUM:
This is causing our INP analysis to miss some valuable attribution info.
It seems like the generate
script responsible for moving the web-vitals.js code from node_modules
to static/js/
doesn't run as part of the pre-deploy action nor the deploy
script.
Hmm I take that back. run_and_test_website.sh
which is part of the pre-deploy action should run the generate
script. Now I wonder why didn't it update.
Oh! The generate
script moves the new version into static/js
which is in our .gitignore file, so it never gets included in the PRs.
We upgraded to version 3.5.2 as part of #802. The next predeploy script was #804, but it only contained the timestamp updates and not the web-vitals.js changes.
That's correct. We don't store the generated JS in git (note it's not here: https://github.com/HTTPArchive/httparchive.org/tree/main/static).
But it should be generated locally as part of the deploy process and then pushed to prod. As part of npm run deploy
.
I know that for the past couple of deploys I did, the deployment script started up a local web server and then stopped running. So I just manually pushed it with gcloud app deploy
at that point, apparently skipping the build/generate/test steps.
@tunetheweb do you remember if your deployment after #804 ran normally?
Always does! :-)
I've just re-deployed and it's there now: https://httparchive.org/static/js/web-vitals.js?test=123456
I suspect you deployed without running npm run generate
and so uploaded an old copy and overwrote my previous (successful!) deploy :-)
Here's the January 28th deploy and it's the correct version: https://20240128t130208-dot-httparchive.uk.r.appspot.com/static/js/web-vitals.js?test=123456
Nice ok so I should figure out why the deployment script craps out for me, or maybe we should move the install/build/generate steps before starting the server?
With #823 merged and the latest version deployed I think we can close this. Thanks for your help tracking it down @tunetheweb!