I just ran an upgrade on a standard install and it’s got a bunch of javascript errors. Only official plugins. Still broken in safe-mode.
AI-generated summary
The discussion revolves around JavaScript errors on a Discourse site after an upgrade, with the issue traced to a CDN optimization feature. pfaffman reports errors in vendor.js and notes the problem persists in safe mode. david suspects the CDN is modifying the JavaScript, pointing to a difference between the CDN-hosted version (https://turivers3.b-cdn.net/...) and the direct server version (https://www.turiver.com/...). The CDN is identified as bunny.net, which has an optional optimizer for JS files. pfaffman confirms the optimizer is off by default but may have been enabled by the site owner, possibly due to recent changes or deprecation notices. The issue appears to stem from the CDN’s JS optimization breaking the code, likely due to improper minification or token processing.
Can you link the site? Any errors during the rebuild? Any unusual config in the YAML? (e.g. have you overridden USE_EMBROIDER environment variable)
I"ll do another rebuild in a minute. Have not overridden USE_EMBROIDER
The source of all the errors is that first “unexpected token ‘:’” in vendor.js. I’ll be quite surprised if our build pipeline produced an invalid JS file. So I wonder if this is a problem with the CDN modifying (or ‘optimizing’) the JS? ![]()
We’ve seen similar problems before with Cloudflare JS optimisations. It doesn’t look like this particular one is cloudflare, but if things still don’t work after a rebuild then I think it’d be worth checking if the CDN has any kind of optimisation features enabled.
Pretty sure it’s bunny.net. I’ll check on that.
It’s backblaze b2 and bunny.net. I don’t expect either of those to be mucking with stuff.
This is the CDN URL: https://turivers3.b-cdn.net/assets/vendor.4ddd811f702787192b1a4379c2344c3e-ab48f4a3713059059494c7bee582f1315dc601912a6036e4c614f867c467ff2f.br.js
And this is the direct link to the asset, bypassing the CDN: https://www.turiver.com/assets/vendor.4ddd811f702787192b1a4379c2344c3e-ab48f4a3713059059494c7bee582f1315dc601912a6036e4c614f867c467ff2f.js
Just from a quick visual look, these are indeed different. The CDN version is visibly missing some comments, which supports the theory that it’s being run though some kind of minification process.
Looks like they have an optimisation feature for images and JS files:
I was just checking thatm (and didn’t know to remove the “br” from the filename). It looks like the optimizer is off by default and costs $9.95/month).
I’m checking with the site owner to see if they’ve done anything there, which seems highly improbable was the problem. I’m not clear whether they just turned it on (they just noticed some deprecations on the admin panel, so perhaps they did some other “upgrades” too).
