Closed marc4gov closed 1 year ago
Can it be because of the --mode ssr
mode? If you run only client side those it works out?
Cool input, I will have a try to Qwik!
I found the issue @marc4gov, the code should be executed on the client side only.
Juno is using Agent-js underneath which uses IndexedDB for the authentication and which does not exists in NodeJS, therefore the error at build time.
To overcome the issue, you can use the QwikuseVisibleTask$
hook instead of useTask$
. That way it will be executed only on the client side.
useVisibleTask$(async () => {
await initJuno({
satelliteId: "aaaaa-bbbbb-ccccc-ddddd-cai",
});
console.log('Juno mounted');
});
For deployement you will also need the Static Site Generation (SSG) adapter. SSR is in our roadmap but not yet there.
Hope that helps, thanks for giving a try at Juno with Qwik 👍
Following the Getting Started, I replaced the
initJuno
parameter with mysatteliteId
in this Qwik componentroot.tsx
like so:App crashes with this error: