Plenty of articles show you how to use Strapi with various frameworks, such as Gatsby , Next.js , and Nuxt.js , but these frameworks require Node.js for the backend.
This is a companion discussion topic for the original entry at https://strapi.io/blog/rendering-react-ssr-with-deno-and-deno-deploy
shauky
October 27, 2021, 9:25pm
2
// Something happens when getting Json data from STRAPI_API_URL, (formatting perhaps?) piping properly formatted raw data and works.
error: Uncaught (in promise) SyntaxError: Unexpected token N in JSON at position 0
// with error catching
try {
respond data
const response = new Response(body, {
headers: { “content-type”: “text/html; charset=utf-8” },
});
console.log(‘response data?’, data)
event.respondWith(response);
} catch(error) {
console.log(‘Error happened here!’)
console.error(error)
}
SyntaxError: Unexpected token N in JSON at position 0
shauky
October 28, 2021, 2:00am
4
I was able to solve it. The problem was in getData function where I was using a wrong url.