getAlby / js-lightning-tools

Collection of helpful building blocks and tools to develop Bitcoin Lightning web apps
https://www.npmjs.com/package/@getalby/lightning-tools
MIT License
32 stars 14 forks source link

Error on calling await (new LightningAddress("LNURL")).fetch() #86

Closed Firegodbr closed 1 year ago

Firegodbr commented 1 year ago

I tested yesterday(2023-10-3) afternoon and it work fine but right now I got this errors Backend error

const ln = new LightningAddress(process.env.ALBY_LNURL);
await ln.fetch();
Error:
SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at parseJSONFromBytes (node:internal/deps/undici/undici:6498:19)
    at successSteps (node:internal/deps/undici/undici:6472:27)
    at node:internal/deps/undici/undici:1145:60
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Test on the front end error:

const ln = new LightningAddress("someone");
await ln.fetch();
Access to fetch at 'https://lnaddressproxy.getalby.com/lightning-address-details?ln=someone132413%40getalby.com' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
index.modern.js:1     GET https://lnaddressproxy.getalby.com/lightning-address-details?ln=divinebreeze79596%40getalby.com net::ERR_FAILED 404 (Not Found)

How can I fix this?

Firegodbr commented 1 year ago

Okay, now it seems to be back online.