Svelte/kit on CF behaves differently on two domains, with the same deployment
Hey all, I've deployed a svelte app using cloudflare pages, but it's behaving really really weirdly.
https://discord.com/channels/457912077277855764/1239235015422902372 - is my post in the svelte discord, but to simplify it, it works in the default pages.dev domain, but not with my custom menu.cruncho.app domain... and I've got no idea why
16 Replies
I can't actually tell if this is an issue on the cloudflare side or the svelte side... so I've put it here just in case!
I'm seeing a bunch of subresource hash failures on the custom domain. Might it be that you are hard-coding the
pages.dev
domain somewhere, which breaks the hashes?no reference to pages.dev on my end
the only error I see is this:
I'm completely new to svelte so bear with me! š
there's only a few differences between Custom Domains and the pages.dev, the primary ones being
- minification
- caching
ooh, good point
ah, could it be that the minification could be causing an issue?
could be, I'm not familiar with svelte too much either but I know some frameworks break with it lol
You can turn it off under Speed -> Optimizations -> Content Optimization -> Auto Minify
(under websites -> click on your website in Cloudflare)
Magic Link: https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization/content
turn off Rocket Loader as well if that's on, it's just above Auto Minify. I don't see it on your site, but just another thing that could cause issues
Disabled everything
no luck still - also purged my cache
Oh
it's working
š
is
hydration_missing_marker_open
something from your app?
ah niceDamn, that's a really strange error
thanks a bunch
hydration_missing_marker_open
I genuinely couldn't tell you šsince you did both so close together hard to say which fixed it
I'm assuming it was minification, caching can also cause issues but all your assets look like they have hashes in the name and no cache on html
it's svelte, it just wasn't showing anything on google but github search returns it
kk, just glad I got that fixed, really appreciate it š