Alex
Alex
NNuxt
Created by Alex on 7/18/2024 in #❓・help
Using Nuxt/Content works in nuxt dev but doesn't work after nuxt generate
HTTP 7/18/2024 1:43:46 AM ::1 GET /api/_content/query/2Icfb2QCm3.1721281352225.json?_params=%7B%22where%22:%5B%7B%22_path%22:%22--REGEX+%2F^%5C%5C%2Fblog%2F%22%7D%5D,%22sort%22:%5B%7B%22_stem%22:1,%22$numeric%22:true%7D%5D%7D

HTTP 7/18/2024 1:43:46 AM ::1 Returned 404 in 2 ms

HTTP 7/18/2024 1:43:49 AM ::1 GET /api/_content/query/f8YtTx8L6u.1721281352225.json?_params=%7B%22first%22:true,%22where%22:%5B%7B%22_path%22:%22%2Fprojects%22%7D%5D,%22sort%22:%5B%7B%22_stem%22:1,%22$numeric%22:true%7D%5D%7D

HTTP 7/18/2024 1:43:49 AM ::1 Returned 404 in 2 ms
HTTP 7/18/2024 1:43:46 AM ::1 GET /api/_content/query/2Icfb2QCm3.1721281352225.json?_params=%7B%22where%22:%5B%7B%22_path%22:%22--REGEX+%2F^%5C%5C%2Fblog%2F%22%7D%5D,%22sort%22:%5B%7B%22_stem%22:1,%22$numeric%22:true%7D%5D%7D

HTTP 7/18/2024 1:43:46 AM ::1 Returned 404 in 2 ms

HTTP 7/18/2024 1:43:49 AM ::1 GET /api/_content/query/f8YtTx8L6u.1721281352225.json?_params=%7B%22first%22:true,%22where%22:%5B%7B%22_path%22:%22%2Fprojects%22%7D%5D,%22sort%22:%5B%7B%22_stem%22:1,%22$numeric%22:true%7D%5D%7D

HTTP 7/18/2024 1:43:49 AM ::1 Returned 404 in 2 ms
these are my errors btw
7 replies
NNuxt
Created by Alex on 7/18/2024 in #❓・help
Using Nuxt/Content works in nuxt dev but doesn't work after nuxt generate
export default defineNuxtConfig({
ssr: true,
css: [
'vuetify/lib/styles/main.sass',
'@mdi/font/css/materialdesignicons.min.css',
'@fortawesome/fontawesome-free/css/all.css'
],

build: {
transpile: ['vuetify']
},

vite: {
define: {
'process.env.DEBUG':false
}
},

devtools: { enabled: true },
modules: ['@nuxt/content'],

routeRules: {
'/': { prerender: true }
},

compatibilityDate: '2024-07-17'
})
export default defineNuxtConfig({
ssr: true,
css: [
'vuetify/lib/styles/main.sass',
'@mdi/font/css/materialdesignicons.min.css',
'@fortawesome/fontawesome-free/css/all.css'
],

build: {
transpile: ['vuetify']
},

vite: {
define: {
'process.env.DEBUG':false
}
},

devtools: { enabled: true },
modules: ['@nuxt/content'],

routeRules: {
'/': { prerender: true }
},

compatibilityDate: '2024-07-17'
})
thats my updated nuxt.config.ts
7 replies
NNuxt
Created by Alex on 7/18/2024 in #❓・help
Using Nuxt/Content works in nuxt dev but doesn't work after nuxt generate
still doesnt work
7 replies
NNuxt
Created by Alex on 7/18/2024 in #❓・help
Using Nuxt/Content works in nuxt dev but doesn't work after nuxt generate
const fetchData = async():Promise<BlogPost[]> => { const { data } = await useAsyncData('blogs',() => queryContent('/blog').find()) console.log(data) if(data.value && Array.isArray(data.value)) { return data.value.map((item:any) => ({ description: item.description, date: item.date, tags: item.tags, title: item.title, content: item })) as BlogPost[] } return [] } this is one of the ways I'm retrieving data btw
7 replies