upstash / qstash-js

Message queue for serverless
https://docs.upstash.com/qstash
MIT License
133 stars 11 forks source link

Issue creating adding endpoints to a topic: Unexpected token C in JSON at position 0 #60

Closed fmoessle closed 9 months ago

fmoessle commented 9 months ago

When adding endpoints to a topic I get the following error using "@upstash/qstash": "2.1.7" and node v18.17.1

await qstash.topics.addEndpoints({
  name: 'my_topic',
  endpoints: [{ url: 'my_endpoint' }]
})

Strangely the endpoint gets added to my topic.

Unexpected token C in JSON at position 0
  at JSON.parse (<anonymous>)
  at parseJSONFromBytes (node:internal/deps/undici/undici:6662:19)
  at successSteps (node:internal/deps/undici/undici:6636:27)
  at node:internal/deps/undici/undici:1236:60
  at node:internal/process/task_queues:140:7
  at AsyncResource.runInAsyncScope (node:async_hooks:203:9)
  at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
chronark commented 9 months ago

Ah so sorry, I forgot to commit that fix earlier.

try again with v2.1.8 please :)