System Information
- Next.JS:
- Strapi 4.1.1:
- macOS Monterey:
- sqlite3:
- Node 14.x.x:
- Yarn 1.23.0:
For my portfolio I am calling data from my API related to specific projects of mine whose pages are dynamically generated with Next.js. Anyway, I make the call to the API but am missing deeper information that I can’t seem to extract.
export const getServerSideProps = async (context) => {
const pid = context.query.pid;
const url = process.env.STRAPI_API_URL;
const query = qs.stringify(
{
populate: '*',
},
{
encodeValuesOnly: true,
}
);
const res = await axios.get(`${url}/projects/${pid}?${query}`);
const projectData = res.data.data;
return { props: { projectData, url } };
};
This returns:
‘samples’ is fully populated but ‘technologies’, which is a relational content type, is missing an ‘icon’ field (which is a media type) that I cannot seem to populate.
I’ve tried every request configuration listed here but nothing seems to work.
Maybe someone has an idea? Even a separate query like ‘http://localhost:1337/api/projects/1?populate[technologies][fields][0]=icon’ returns a 500 error.