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

document is not defined error in Cloudflare worker #129

Open
motss opened this issue Dec 30, 2024 · 0 comments
Open

document is not defined error in Cloudflare worker #129

motss opened this issue Dec 30, 2024 · 0 comments

Comments

@motss
Copy link

motss commented Dec 30, 2024

Description

The following LoC is causing an error in the wrangler action and local wrangler running the preview command.

globalThis[ID] = globalThis[ID] || {
sheet: !!document.adoptedStyleSheets
};

Expected behavior

Atomico + Astro + Cloudflare worker integration should work without any issue from build to deployment.

Actual behavior

Atomico + Astro + Cloudflare worker integration fails at the deployment step with the following error from wrangler:

✘ [ERROR] service core:user:test-astro-ts: Uncaught ReferenceError: document is not defined

    at null.<anonymous> (oi1s013v6f.js:8200:12)

Reduced test case

git clone this repo to test with local wrangler.

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

1 participant