You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How we import is overly-complicated and developers will probably be confused as why it's necessary. The project currently does not compile correctly serverside (in NextJS) so code like this is needed:
"use client"importdynamicfrom'next/dynamic';constButton=dynamic(()=>import('@getalby/bitcoin-connect-react').then((mod)=>mod.Button),{ssr: false,});// Render the Button normally<Button/>// or to use the API:<buttononClick={async()=>{constlaunchModal=awaitimport('@getalby/bitcoin-connect-react').then((mod)=>mod.launchModal);launchModal();}}>Launchmodal</button>
I wonder if it's how the lit dependency is being bundled by bitcoin connect. I moved it to be a dev dependency due to Lit always giving a warning about being in dev mode, but that might actually stop it from being compiled correctly in a NextJS project.
In Authoring components it says "Don't bundle Lit into published components."
How we import is overly-complicated and developers will probably be confused as why it's necessary. The project currently does not compile correctly serverside (in NextJS) so code like this is needed:
Referencing #153
Ideally Button and launchModal can be directly imported and just work.
The text was updated successfully, but these errors were encountered: