nuxt / content

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

Azure Static Web Apps and Nuxt Content #2521

Closed owljackob closed 2 months ago

owljackob commented 8 months ago

Environment


Reproduction

Let me know if it needs reproduction.

Describe the bug

I query content directly in [...slug] and have a custom transformer written. I use the following query to do this:

const route = useRoute();
const { data, error } = await useAsyncData("article-detail", () => queryContent(route.path).only(["description", "body"]).findOne());

It works fine when I use navigateTo(_path) from the article list (index.vue) but this is what I receive when I try to load the article directly. Surprisingly, when I use the API directly (as below), it returns everything correctly.

Error: [GET] "/api/_content/query/4CktpAQDgT.1705965443072.json?_params=%7B%22only%22:%5B%22description%22,%22body%22%5D,%22first%22:true,%22where%22:%5B%7B%22_path%22:%22/en/article/240123%22%7D%5D,%22sort%22:%5B%7B%22_file%22:1,%22$numeric%22:true%7D%5D%7D": <no response> Response is not defined

/api/_content/query/4CktpAQDgT.1705965443072.json?_params={"only":["description","body"],"first":true,"where":[{"_path":"/en/article/240123"}],"sort":[{"_file":1,"$numeric":true}]}

Although I think there is a better way to achieve the same thing, I think it should work.

Additional context

No response

Logs

No response

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

owljackob commented 2 months ago

@farnabaz, could this issue be deleted at all – not just closed, please?

farnabaz commented 2 months ago

I can't delete the issues, sorry. We can close the issue if don't want any notification from it