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

Cloudflare adapter build fail for svelte component #490

Closed
1 task
rdlogout opened this issue Dec 19, 2024 · 1 comment
Closed
1 task

Cloudflare adapter build fail for svelte component #490

rdlogout opened this issue Dec 19, 2024 · 1 comment

Comments

@rdlogout
Copy link

Astro Info

Astro                    v5.0.9
Node                     v20.11.1
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/svelte

Describe the Bug

When developing the app locally everything works smoothly (because we are using nodejs for dev), but when we try to build the app without any changes it throws error

16:30:18 ▶ src/pages/index.astro
16:30:18 └─ /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.

this is when we pass any children to svelte component and try to render the children.

I have tested with other adapters (deno and node) things works expected, children passed are rendered and build is completed.

What's the expected result?

It should render the passed children in SSR and build should complete
image
image

Link to Minimal Reproducible Example

https://github.com/rdlogout/cfastrodebug

Participation

  • I am willing to submit a pull request for this issue.
@rdlogout rdlogout changed the title Cloudflare adapter build faild for svelte component Cloudflare adapter build fail for svelte component Dec 19, 2024
@alexanderniebuhr
Copy link
Member

alexanderniebuhr commented Dec 19, 2024

Duplicate of #456

@alexanderniebuhr alexanderniebuhr closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@alexanderniebuhr alexanderniebuhr marked this as a duplicate of #456 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants