D
Deno

help

Preact hooks doesn't get executed!

Wwedman10/9/2023
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 ) }
IioB10/9/2023
I recommend checking out the docs: https://fresh.deno.dev/docs/concepts/islands
Interactive islands | Fresh docs
Islands enable client side interactivity in Fresh. They are hydrated on the client in addition to being rendered on the server.
IioB10/9/2023
All interaction must happen within islands
Mmarvinh.10/9/2023
What lino said. Fresh is a server first framework and it expects you to opt into client side code via islands
Wwedman10/9/2023
@lino-levan @marvinh. Thank you! I'm looking into it! Would you be against a DM if I have further questions?
IioB10/9/2023
Feel free to post in this thread! It's better for searchability in case others get stuck on the same problem.
Wwedman10/9/2023
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.
No description
No description
No description
No description
Wwedman10/9/2023
How can it be that listOfInvoices has data when fetched but later when used inside of the html it's empty?
Wwedman10/9/2023
I think i understand the problem, when fetching this error gets thrown into the browser console!
No description
Wwedman10/9/2023
here is the invoicesUtils.ts
No description
Wwedman10/9/2023
so the problem has to do with retrieving the supabase url and key
Jjavi10/9/2023
you cant use Deno.* there. Either a call to an api in the routes/api/ folder, or a handler in that route
Jjavi10/9/2023
this and this for reference
Creating a CRUD API | Fresh docs
Use HTTP CRUD methods to perform operations on resources. Learn how to use HTTP handlers to create a RESTful API.
Routes | Fresh docs
Routes are the basic building block of Fresh applications. They are used to define the behaviour the application when a given path is requested.
Wwedman10/9/2023
Ahhh! I will need some time to understand it properly! Thank you!
Jjavi10/9/2023
youre welcome!

Looking for more? Join the community!

Recommended Posts
Deployment fails with "An internal server error occured" - no further detailsMorning, I receive the mentioned message without any pointers of what the issue could be. The issueWhy was Preact used for Deno Fresh instead of Superb Vue.js?I am curious as to why is all.Sentry - monkey patching globals?I'm working with Sentry to release a Deno SDK. To capture breadcrumbs and tracing for console/fetchWhats the CPU time limit for queue worker processes running on Deno Deploy ?There is a CPU time limit for request. Is there any limit for the new KV queue ?Using Deno runtime as a v8 isolate runnerDeno is awesome, not just the end product but also the core runtime. I've spend the past couple of wCannot find moduleI tried importing '../api/index.js' but got the error 'module not found', I knew this error would aphow to configure deno lint with additional rules + optionsSpecifically I'd like to restrict some imports - is that possible with deno lint?How to read all text from stdin.It uses to be simple with the `Deta.readAll` function. Now it is deprecated, link to https://deno.lIs it possible to use Deno KV on subhosting?I'm using Deno subhosting and i would like to know if it's possible to use KV on subhostingError only happens when I'm on deno deployPlease can someone explain why with my web application when deployed in deno deploy I get this respoDeno Deploy - is it possible to have 2 servers running?Maybe Im using it completely wrong, but locally when i develop I have two Deno servers running: BacNPM package randomly brokeI've been using the imagekit package for my fresh project, and it's been working fine since I instalsubpackage imports with npm specifierse.g. `import colors from "npm:tailwindcss/colors"` currently fails, is this not supposed to work? SIs it possible to use Cache-Control headers to control Deno's cacheI've seen via an issue ( https://github.com/denoland/deno/issues/16296 ) that Deno stores its metadaDeno Deploy Queue trouble in productionI'm encountering an issue with Deno Queue in my Deno Deploy project, and I'm hoping to get some guidDeno compile target errorHello, I am trying to compile a Deno api using `deno --unstable ./path/to/api/index.ts --output ./paHow to avoid the method POST to executed in the URL I am redirected to?How to avoid the method POST to executed in the URL I am redirected to? routes/admin/login.tsx ```thow to use Untar without deprecated functions?`Untar` from std/archives requires an instance of `Reader` - apparently most functions return some RHelp, does the middleware example in the Deno Fresh documentation not work for anyone else?I tried to follow the example in Deno Fresh about middlewares, but it doesn't work, the content `ctxDeno Cache locationHello, I am trying to cache my dependencies during the compile action using Github Actions, where do