Dex_Vinyl
Dex_Vinyl
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai it works just fine as a [...].ts file in the \server\api\[genreId] folder
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai with [...].ts file in the \server\api\[genreId]folder, the [...].tsis hit. once it gets to \server\api\[genreId]\release it fails
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai it appears that without a /1 the page is NOT being hit
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai adding the ? removes the ide error, but without the /1 i still get the html of the welcome to nuxt page as the output
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai using the const slug = event.context.params.slug line in the above example, gives an IDE error of could be unassigned, but makes no change to the execution
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai Exact Path of file: \server\api\[genreId]\releases\[...slug].ts I've renamed the file to [...slug].ts and changed the page references to slug nuxt.config.ts file:
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
modules: ['@prisma/nuxt']
})
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
modules: ['@prisma/nuxt']
})
No console errors
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai there currently is no app.vue this is in /server/api/...
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai I've rebuil;d the whole [...page].ts file, the output is still the same however, page 1, when there is no /1 on the end, renders the Welcome to nuxt page, add the /1 it brings page 1 of the api output
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai we've tried this before!
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai as mentioned previously using [[page]] does not work for some reason
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai this still does not work for pages with no slug which would be the case for page 1, however it works perfectly still for pages 2+ my implementation:
const genreId = getRouterParam(event, "genreId");
const slug = getRouterParam(event, 'page') || ['1'];
const pageNumber = Number(slug[0]) || 1
const genreId = getRouterParam(event, "genreId");
const slug = getRouterParam(event, 'page') || ['1'];
const pageNumber = Number(slug[0]) || 1
65 replies
NNuxt
Created by Dex_Vinyl on 12/17/2024 in #❓・help
server/api errors using [[ ]].ts files
@kapa.ai this suggestions works only when [or-is-it] has a value, if the root of the folder is hit, error message occurs, despite having the || 1 on the const as suggested
65 replies