Fix Invalid routes.json (SvelteKit and Cloudflare)

How to fix the "Detected rules the are over the 100 character limit." error

TL;DR check if some of your file names are too long.

You might get this error sometimes when building a Sveltekit site in Cloudflare or uploading its build via wrangler:

Invalid _routes.json file found at: .svelte-kit/cloudflare/_routes.json

Detected rules the are over the 100 character limit. Please make sure that each include and exclude routing rule is at most 100 characters long.

The fix for me was pretty simple. If you examine _routes.json, I had an issue where I had assets with really long file names. I reduced the file name of these images and the error went away!

)