How can I include CSR-only functions with Fresh? #2774
Replies: 1 comment
-
This is a general strategy, not specific instructions. It will take some trial and error. When you import in this way, Deno (the server side runtime) is the first thing seeing What you really want is to include a totally separate non-Deno script built for the browser specifically. If you can identify a pre-compiled bundle in a CDN somewhere, that'll save you some work. Or you can build your own (probably using Vite) and serve it via the As for actually including the script, I don't know if a |
Beta Was this translation helpful? Give feedback.
-
Pls see the details at the stackoverflow page.
My question is, when I tried to include a function (which operates browser-specific objects like
document
) and ensure it to be rendered client-side only, it always claims thatdocument
is not available. Here is what I tried:and it claims
Beta Was this translation helpful? Give feedback.
All reactions