SolidJSS
SolidJSโ€ข3y agoโ€ข
2 replies
FjordWarden

createResource does not working with json()

Why does text() work but json() does not:

let [schema1] = createResource(async _ => await (await fetch(`https://api.localhost/`)).json());
let [schema2] = createResource(async _ => await (await fetch(`https://api.localhost/`)).text())


I am sure the content I get back is valid JSON and changing the content type has no effect.

I can't think of a reason why this difference in behaviour?
Was this page helpful?