Alright, after a lot of hair loss I’ve narrowed down a very significant bug.
I have a SvelteKit site (which uses Vite under the hood) and it’s using auth0-spa-js, which pulls in core-js.
The issue appears because core-js uses a weird syntax to get the toString function of a number, like so: 1.0.toString
this will then windup getting minified to 1 .toString
The issue comes with CF, after it applies it’s own minification: 1 .toString
turns into: 1.toString
Disabling minification in Vite doesn’t work, as: 1.0.toString
will still get minified by CF, to: 1.toString
(Links are not allowed, but you can see the weird syntax yourself in uid.js (ln#5) in the core-js repo.)
I’m having the same problem with Home Assistant and the Zigbee2MQTT addon (https://github.com/zigbee2mqtt/hassio-zigbee2mqtt). The Web GUI for Z2M does not load due to several instances of 1.toString in the minified code when minifying is enabled.