Baljeet Singh
I upgraded my personal website from primevue to shadcn-vue, but build is failing on netlify.
Just deployed on vercel, and it worked well. So, should be an issue with netlify i guess. Anyone else experienced this before.
https://baljeetsingh-6g7322qqh-baljeet-singhs-projects-bcdf9fec.vercel.app/
4 replies
runtimeConfig not working when website deployed to netlify
I have now set the blog routes to prerender
It works well in general. There is a minor issue with the pagination. I'm using query string params. It works well if i don't prerender routes. But, doesn't work as expected when i prerender (works on local though).
If i just use the prev and next buttons it is ok.
But, If i'm on a route, let's say
https://www.baljeetsingh.in/blog?page=2
and then i try to refresh. It shows the content of the first page always. I assume this is the expected behavior with prerender.
Do you have any insights on how you would go about solving this issue.26 replies
runtimeConfig not working when website deployed to netlify
For nuxt content I'm using useAsyncData. I assume this is why it pretenders.
<script setup lang="ts">
const { data: courses } = await useAsyncData('courses', () =>
queryContent('/courses')
.without('body')
.where({ published: { $eq: true } })
.sort({ publishedAt: -1 })
.find()
);
</script>
26 replies
runtimeConfig not working when website deployed to netlify
btw, I had previously added
useYoutubeVideos
composable and called the youtube api from there. I think then it wasn't calling the api (not certain).
But, it felt like creating server route is the right way to hide the key.26 replies
runtimeConfig not working when website deployed to netlify
Hi @manniL / TheAlexLichter
I watched the video and updated the environement variable to
NUXT_YOUTUBE_API_KEY
on netlify.
This looks to be working.
Thanks
Also, I have set the video route to prerender, but it seems to be hitting the api again and again.
Am i doing something wrong?
I just want to prerender everything if possible.
On local I did npm run generate
and then used serve on .output/public
directory.
But, when i use this build command and directory on netlify, the build fails.
Currently, it deploy is only working with npm run build
and dist
. Then, I'm not sure which routes are prerendered.26 replies