I followed a tutorial about NextJS and have now tried to modify it a bit. I wanted to include the data.json file in the page. But I always get the error message "Unexpected token < in JSON at position 0".
I know that I should convert the JSON file into a string(?). How do I have to do that?
let res = await fetch(`${server}/data`);
const articles = await res.json();
return {
props: {
articles,
},
};
}
My GIT-Repo is here: https://gitlab.com/pauernet/nextjs-test/