Require, I18n, define not defined? due to optimizer breaking javascript

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.

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)

1 Like

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? :thinking:

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 I’ll check on that.

It’s backblaze b2 and I don’t expect either of those to be mucking with stuff.

1 Like

This is the CDN URL:

And this is the direct link to the asset, bypassing the CDN:

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).


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.