#Preact hooks doesn't get executed!

1 messages · Page 1 of 1 (latest)

hoary topaz
#

im having a little problem, the hooks from preact doesn't seem to run, canst see any errors in the terminal and the dependency is imported. Would love to get help:)
import { useEffect } from "preact/hooks";

export default function MyPage() {
useEffect(()=> {
console.log("this message will not be executed:(")
}, []);
return (
blah blah blah
)
}

haughty ice
#

All interaction must happen within islands

long sapphire
#

What lino said. Fresh is a server first framework and it expects you to opt into client side code via islands

hoary topaz
#

@haughty ice @long sapphire Thank you! I'm looking into it! Would you be against a DM if I have further questions?

haughty ice
#

Feel free to post in this thread! It's better for searchability in case others get stuck on the same problem.

hoary topaz
#

im trying to display a invoice and i log the data when fetching it from my supabase(as seen in the blue console screenshot). When the invoices are loaded i try to display it in the table but nothing is there. i have a button for dubug purposes that logs listOfInvoices.value to the console and when i do that it is displaying a empty array.

#

How can it be that listOfInvoices has data when fetched but later when used inside of the html it's empty?

#

I think i understand the problem, when fetching this error gets thrown into the browser console!

#

here is the invoicesUtils.ts

#

so the problem has to do with retrieving the supabase url and key

late fern
#

this and this for reference

hoary topaz