sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.21k stars 4.09k forks source link

Sveltekit with Svelte5 renders apps twice on viewport when behind a cname #10735

Closed zachczx closed 3 months ago

zachczx commented 6 months ago

Describe the bug

Sveltekit with Svelte5 renders the app twice on the viewport, one app on top of another app. The top one is generally non responsive and clicks to elements on the top app leads to responses in the bottom app.

This happens when you deploy a Sveltekit app on Svelte5 to Cloudflare Pages, use a custom domain (CNAME pointing to the pages.dev page). Using a direct URL is fine, so it appears to be something about using a CNAME with Svelte5.

Reproduction

https://test.zixian.dev/ https://github.com/zachczx/test.git

The git page is just a generic install of release 73 I pulled this morning, and carries the same problem in prior versions as well.

Logs

No response

System Info

(Doesn't replicate on localhost for reasons stated above)  

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 20.66 GB / 31.93 GB
  Binaries:
    Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (122.0.2365.80)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    svelte: ^5.0.0-next.73 => 5.0.0-next.73

Severity

annoyance

aeons commented 6 months ago

I am seeing the same, with a slightly different setup: SvelteKit using the node adapter on a regular server, behind Cloudflare proxied DNS. Exact same setup works fine without proxied DNS.

shamokit commented 5 months ago

I also encountered the same problem, but it was resolved by unchecking HTML in Auto Minify. img