nuxt-modules / strapi

Strapi Module for Nuxt
https://strapi.nuxtjs.org
MIT License
644 stars 80 forks source link

Problem with fetch data in production #400

Open milanblasko28 opened 8 months ago

milanblasko28 commented 8 months ago
node:"20.5-alpine"
"nuxt": "^3.10.3"
@nuxtjs/strapi": "^1.11.0",

Hi, I have problem with fetch data in production mode. I fetch like this: const { data: products, refresh: refreshProducts } = await useAsyncData("sanitary-cabins", () => find<any>("sanitary-cabins", { populate: "*" }) );

In development mode everything is okay. If I go to site data are fetch, but If I refresh page I get 500 error and in network is not any API call. When I fetch API using useFetch everything works fine.

chenjackle45 commented 6 months ago

Hi @milanblasko28 ,

I encountered the same issue with fetching data in production mode using useAsyncData. In development mode, everything works fine, but I get a 500 error when refreshing the page in production mode, and there are no API calls in the network tab.

Have you managed to resolve this issue? If so, could you please share your solution?

Thank you!