Open lishaduck opened 5 months ago
Thank you for the issue, I imagine we could implement the same change to use typeof document !== 'undefined'
in the remainder of the places where window !== 'undefined'
is used. Would you like to open a PR for this?
Thank you for the issue, I imagine we could implement the same change to use
typeof document !== 'undefined'
in the remainder of the places wherewindow !== 'undefined'
is used.
I think that should fix it. Checking the stacktrace, here're the potential culprits (though it should probably be fixed everywhere): Code Search Results
Would you like to open a PR for this?
I don't think I can sign a CLA, so I'll decline. Otherwise, I'd be happy to. Thanks for your responsiveness!
Provide a general summary of the issue here
There are many
typeof window == 'undefined'
checks in this codebase. In Deno 1.x,window
is defined, so these are incorrect. In Deno 2, it won't be becuase of this sort of issue, but you can't opt-in to the upcoming Deno 2 behavior in Deno Deploy, though there is a flag locally.Many people, including me, are using HeadlessUI with Fresh, and HeadlessUI 2 uses
react-aria
. Fixing this requires hacky workarounds on our side.๐ค Expected Behavior?
SSRing in Deno should work. #4676 and #4688 suggest that react-aria should support Deno.
๐ฏ Current Behavior
(An example from denoland/fresh#2426, as I don't have a broken file on me right now)
๐ Possible Solution
Always use
@react-aria/ssr
, which, on first glance, doesn't seem to have this issue?๐ฆ Context
I'm trying to remove lots of
if (!IS_BROWSER)
checks in my codebase.๐ฅ๏ธ Steps to Reproduce
I can't access CodeSandbox, and you'd need Deno anyway (presumably it uses Node).
Version
https://github.com/PHS-TSA/webmaster-23-24/blob/90ea1948753785c8df482facfd6a96e134d0448f/deno.json#L76-L80
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
macOS
๐งข Your Company/Team
Fresh Users
๐ท Tracking Issue
denoland/fresh#2206 denoland/fresh#2426 denoland/deno#23784