lightninglabs / lnc-web

Lightning Node Connect npm module for web
https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/lnc-npm
48 stars 18 forks source link

Better error handling when loaded in server #72

Open apotdevin opened 1 year ago

apotdevin commented 1 year ago

In frameworks like NextJS, components are server side rendered by default unless specified. This causes issues with this lib and causes it to throw a self is not defined error which isn't very informative of why it's failing.

It would be nice if this scenario could be handled internally in the lib and return an accurate error of the reason for failing.

itsrachelfish commented 1 year ago

You also get the self is not defined error if you try to use lnc in node.js on the command line