Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Svelte + Cloudflare] Cannot build if the page is prerendered and contains Svelte @render with Cloudflare #12571

Closed
1 task
GoodLucky777 opened this issue Nov 30, 2024 · 1 comment
Labels
needs triage Issue needs to be triaged

Comments

@GoodLucky777
Copy link

GoodLucky777 commented Nov 30, 2024

Astro Info

Astro                    v4.16.16
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   hybrid
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/svelte

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

No response

Describe the Bug

If I build an Astro website that contains prerendered page with Svelte @render children and Cloudflare integration, the build error occurs. If I remove Cloudflare integration or change prerendered to false, it doesn't.

Build error log:

$ npm run build

19:36:06   └─ /index.htmldocument is not defined
  Hint:
    Browser APIs are not available on the server.
    
    If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.
    
    See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.
    
  Stack trace:

What's the expected result?

The build should be successful.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/astro-svelte-cloudflare-prerender-build-error

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 30, 2024
@GoodLucky777
Copy link
Author

Moving it to withastro/adapters#456

@GoodLucky777 GoodLucky777 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant