Skip to content

v6 + Cloudflare + Preact useEffect doesn't work in local dev #15361

@NuroDev

Description

@NuroDev

Astro Info

Astro                    v6.0.0-beta.6
Node                     v24.12.0
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/preact

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

If you use the v6 beta of astro with the Cloudflare adapter (also using the beta version) and then try to add some kind of Preact (I saw the same issue for the React integration on first-load but never again thereafter) client component that uses useEffect with a client:load directive it will fail to render both the client component and anything else below it in the render tree.

This only seems to affect the local Astro development server. If you generate a build and run wrangler dev it will work and render just fine.

What's the expected result?

Ideally this should work similar to v5 where you can use client:load directive on any client component, including those with a useEffect.

Link to Minimal Reproducible Example

https://github.com/nurodev/repro-astro-v6-use-effect-on-load

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: cloudflareRelated to the Cloudflare adapterpkg: preactRelated to Preact (scope)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions