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.)
You can use Page Rules to disable Auto Minify for a specific URL/pattern, rather than doing it on the entire zone.
Yep, got suggested this by another person as well. I’ve done that now and now the rest of site is happy. Still would like to see this issue resolved though.
Facing the same issue. We have the combination of Vite + Auth0-SPA, which uses core-js which produces that Bad Minify.
I had the same issue. I am using Vite.
Disabling auto minification of JS solved this problem. This can be done in the settings Speed → Optimization → Auto Minify.
Does anybody have a ticket# or test page we can escalate to Support to have them look into this?
You can just make a vite-based project (vue, svelte, etc) and include auth0-spa-js.
You grossly overestimate my whatever-it-is-you’re-doing ability.
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.
I think the problem is relative to core-js, fix could be made from them or from Cloudflare…vite minification work’s good, but Cloudflare break it.
I have the same exact issue.
Managed to get stack trace of the error with js minification:
index.c0cc3410.js:1 Uncaught SyntaxError: Invalid or unexpected token (at index.c0cc3410.js:1:5577)
at t.activateScript (rocket-loader.min.js:1:11855)
at t.run (rocket-loader.min.js:1:11259)
at P (rocket-loader.min.js:1:3128)
at Object.callback (rocket-loader.min.js:1:2851)
at t.run (rocket-loader.min.js:1:11340)
It seems like issue is with Rocket loader CF feature.
For the reference issue on zigbee2mqtt github can be found here: