stibbs
10/22/2021, 4:44 AMts
const { data, error, count } = await supabase
.from('jobs')
.select('id', { count: 'exact', head: true })
.gt('valid_until', 'now()')
.neq('closed', 'true');
bash
invalid json response body at https://cdylbjsfwtolxghadbnk.supabase.co/rest/v1/jobs?select=id&valid_until=gt.now%28%29&closed=neq.true reason: Unexpected end of JSON input
FetchError: invalid json response body at https://cdylbjsfwtolxghadbnk.supabase.co/rest/v1/jobs?select=id&valid_until=gt.now%28%29&closed=neq.true reason: Unexpected end of JSON input
at C:\Users\matt\proj\bread\node_modules\node-fetch\lib\index.js:272:32
at processTicksAndRejections (internal/process/task_queues.js:95:5)
Steve
10/22/2021, 6:59 PMjobs
table have?stibbs
10/22/2021, 9:19 PMstibbs
10/22/2021, 9:34 PMload
and into onMount
I now get some feedback...
API call comes back 200 OK
but then when I run await response.json()
I get
Uncaught (in promise) SyntaxError: Unexpected token T in JSON at position 0
stibbs
10/22/2021, 9:36 PMjs
body: ReadableStream
bodyUsed: true
headers: Headers {}
ok: true
redirected: false
status: 200
statusText: "OK"
type: "basic"
url: "http://localhost:3000/api/count"
[[Prototype]]: Response
stibbs
10/22/2021, 9:43 PMstibbs
10/22/2021, 9:43 PMstibbs
10/22/2021, 9:43 PMSteve
10/22/2021, 10:07 PMhead: true
the response body is actually empty(supabase-js does a HEAD request).stibbs
10/22/2021, 11:31 PMstibbs
10/22/2021, 11:31 PM