nuxt-modules / nuxt-modules/strapi

Problem with fetch data in production

Open
#400 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
717
Forks
89
Avg merge
7h 3m
Merged PRs (30d)
6

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the production refresh failure with the listed Node 20 Alpine and Nuxt 3.10.3 setup. Compare the useAsyncData call using find with the working useFetch path, and inspect the resulting 500 response and server logs. Done means the page refreshes successfully in production and the data request behaves consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, nuxt, typescript
Domain
api, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.