How to use client side scripts #467
Unanswered
austenstone
asked this question in
Q&A
Replies: 1 comment
-
You can ensure code only runs on import { IS_BROWSER } from '$fresh/runtime.ts'
if( IS_BROWSER )
console.debug(`Client Side`)
else
console.debug(`Server Side`) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Disclaimer: I'm a total noob with SSR
It seems islands are the only place where I can ship JavaScript to the client.
I was attempting to import FirebaseUI in an island.
Something like
But I am getting
error: ReferenceError: document is not defined
on the server.I don't want to load this script on the server.
How can I import client side libraries such as firebaseui?
Beta Was this translation helpful? Give feedback.
All reactions