nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.06k stars 622 forks source link

queryContent().find() always gives ALL my documents even if I give a path #1994

Open JulienHenrotin opened 1 year ago

JulienHenrotin commented 1 year ago

Environment


Reproduction

https://stackblitz.com/edit/github-jac6wl?file=app.vue

Describe the bug

Hi ! I face a mysterious problem with queryContent()

In my project i have 2 folders in /content folder : /fr & /en I want to get all documents from one or other folder. So I use queryContent().find() with a string (fr or en) to fetch my doc

allGuides.value = await queryContent(localFolder.value).find() On my production server this request always return ALL my documents. In both folder /fr and /en. Even if I pass a full document path in queryContent it doesn't give me the good document but an array with all my doc. But on localhost and on dev server no problem I have what I want with my request. My project run with a same docker for dev server and prod server.

Do you have any ideas? What could impact the system and change the result of nuxtContent requests?

Observations

In production server, request and answser image image

In developement server, request and answer image image

Additional context

No response

Logs

No response

farnabaz commented 1 year ago

I tried to build and run your reproduction inside Stackblitz, It seems to work fine. Did I miss something in your repro?

Screenshot 2023-04-17 at 15 16 36
JulienHenrotin commented 1 year ago

@farnabaz No you didn't miss anything. I made a reproduction because GitHub ask me. But my problem only appears on my production server. The reproduction it's like my dev environement, no problem no error ... It's really to illustrate my project

farnabaz commented 1 year ago

This is strange, the behaviour should not change in different env. If you be able to create a reproduction, we can debug it faster

JulienHenrotin commented 1 year ago

Yeah, that's why I'm lost on this issue. I use Docker on my test and production server so in theory the environment is the same.

The difference I found is in the header of the request but it's not supposed to change how nuxtContent requests work...

Header request for test server image

Header resquest for production server (the one with problem) image