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:
this will then windup getting minified to
The issue comes with CF, after it applies it’s own minification:
Disabling minification in Vite doesn’t work, as:
will still get minified by CF, to:
(Links are not allowed, but you can see the weird syntax yourself in
uid.js (ln#5) in the core-js repo.)