Skip to content

Flash of white bg when deploying on cloudflare without rocket loader #368

@ElasticBottle

Description

@ElasticBottle

Seeing a flash of white on a tanstack start page during first load.

I have deployed the exact same site via vercel and am not seeing the same issue.

Feels like something weird cloudflare is doing with the loading of scripts. Anyone seen this before?

Using tanstack start with next themes. I have tried using the scriptProps but I think it doesn't work on tanstack start because it doesn't support SSR and still requires js in those case (assuming that is the fix).

Again, I don't have rocket loader enabled for the domain so don't think that should affect things.

Here's my implementation

  <ThemeProvider
          attribute="class"
          defaultTheme="system"
          enableSystem
          // cloudflare magic see https://github.com/pacocoursey/next-themes?tab=readme-ov-file#using-with-cloudflare-rocket-loader
          // scriptProps={{ "data-cfasync": "false" }}
        >
          <Outlet />
 </ThemeProvider>

wragnler.jsonc

{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "rectangular-labs-www",
  "main": ".output/server/index.mjs",
  "preview_urls": false,
  "compatibility_date": "2025-09-07",
  "compatibility_flags": ["nodejs_compat"],
  "assets": {
    "directory": ".output/public"
  },
  "observability": {
    "enabled": true
  },
  "placement": {
    "mode": "smart"
  },
  "routes": [
        {
          "pattern": "pr-257.rectangularlabs.com",
          "custom_domain": true
        }
      ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions