code : "ERR_BAD_REQUEST" Axios error: Request failed with status code 404

Advertisements I’m building an ecommerce website with React and Strapi. When I try to get the products and categories from Strapi this error pops up: GET http://localhost:3000/undefined/api/products?populate=* 404 (Not Found) GET http://localhost:3000/undefined/api/categories?populate=* 404 (Not Found) AxiosError {message: ‘Request failed with status code 404’, name: ‘AxiosError’, code: ‘ERR_BAD_REQUEST’ This is the code from the api.js import axios… Read More code : "ERR_BAD_REQUEST" Axios error: Request failed with status code 404

NuxtJS + Graphql – Everything was well but the post title does not shows up in Template

Advertisements With Nuxt + Strapi + Graphql, I’m trying to show the post title here and below is my code. No error and everything was well but the post title just didn’t show up. If you look at the Graphql query below, I managed to pull out all those post information in Playground. Any idea… Read More NuxtJS + Graphql – Everything was well but the post title does not shows up in Template

Strapi v4 api error "posts.map is not a function" NextJs

Advertisements index.js file export default function Home({ posts }) { return ( <div> {posts && posts.map((post) => ( <div key={post.id}> <h2>{post.Title}</h2> </div> ))} </div> ); } export async function getStaticProps() { const res = await fetch("http://localhost:1337/api/posts&quot;); const posts = await res.json(); return { props: { posts }, }; } and this is the error that… Read More Strapi v4 api error "posts.map is not a function" NextJs

Double nested Array in JSON leads to TypeError: Cannot read properties of null (reading 'map')

Advertisements In my code I try to get to the 2 thumbnail urls in the JSON below. I’m only able to get in the first Array the <>{post.attributes.description}</> but I’m not able to get in the second array the <>{img.attributes.formats.thumbnail.url}</> I am getting the error: TypeError: Cannot read properties of null (reading ‘map’) 11 |… Read More Double nested Array in JSON leads to TypeError: Cannot read properties of null (reading 'map')