Cordobes
Cordobes
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
in development comments are fetching correctly, on production theres no fetch
@kapa.ai const fetchComments = async () => { try { const { data } = await useAsyncData( comments-${postId}-${sitekey}, // Add a more specific key () => $fetch('/api/v1/comments', { method: 'GET', params: { sitekey, post_id: postId, hostname: referer } }) ) console.log(data.value) // Access .value since data is a ref const commentsArray = Array.isArray(data.value) ? data.value : (data.value as { comments: Comment[] })?.comments || [] comments.value = commentsArray.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()) } catch (error) { console.error('Error fetching comments:', error) comments.value = [] } } fetchComments()
10 replies
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
supabase signup pass custom data
@kapa.ai useasync data to response try { const data = await authedFetch<{ comments: Comment[] } | Comment[]>('/api/v1/comments', { method: 'GET', params: { sitekey, post_id: postId, hostname: referer } }) console.log('Fetched comments data:', data) // Check if data.comments exists (API might return an object with a comments property) const commentsArray = Array.isArray(data) ? data : (data as { comments: Comment[] })?.comments || [] comments.value = commentsArray.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()) } catch (error) { console.error('Error fetching comments:', error) comments.value = [] } }
21 replies
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
supabase signup pass custom data
const fetchComments = async () => { try { const data = await authedFetch<{ comments: Comment[] } | Comment[]>('/api/v1/comments', { method: 'GET', params: { sitekey, post_id: postId, hostname: referer } }) console.log('Fetched comments data:', data) // Check if data.comments exists (API might return an object with a comments property) const commentsArray = Array.isArray(data) ? data : (data as { comments: Comment[] })?.comments || [] comments.value = commentsArray.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()) } catch (error) { console.error('Error fetching comments:', error) comments.value = [] } } fix this to useasyncdata
21 replies
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
supabase signup pass custom data
@kapa.ai make this useasyncdata const authedFetch = async <T = any>(url: string, opts: any = {}) => { const headers = { ...opts.headers, Authorization: session.value?.access_token ? Bearer ${session.value.access_token} : undefined } const response = await useFetch<T>(url, { ...opts, headers }) console.log('Raw response:', response) // Handle Nuxt's useFetch response format if (response.data.value) { return response.data.value as T } return null }
21 replies
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
supabase signup pass custom data
@kapa.ai i want to set display_name
21 replies
NNuxt
Created by Cordobes on 3/29/2025 in #❓・help
supabase signup pass custom data
i want to set display_name
21 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
@kapa.ai i am using supabase auth i want to do cross-site login trought a iframe dialoge.pro is the main site where people log in cordobes.fun has <iframe src="https://dialoge.pro/embed/macro" class="w-full h-96"></iframe> how i can log in trought that iframe
27 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
i am using supabase auth
27 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
@kapa.ai
27 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
@kapa.ai is there a better way?
27 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
@kapa.ai i want to do cross-site login trought a iframe dialoge.pro is the main site where people log in cordobes.fun has <iframe src="https://dialoge.pro/embed/macro" class="w-full h-96"></iframe> how i can log in trought that iframe
27 replies
NNuxt
Created by Cordobes on 3/28/2025 in #❓・help
useFetch works perfectly on dev enviroment, on productions fails on pre-hydration
</div> </div> </div> </div> </template> <div v-else class="text-center py-8"> <UIcon name="i-heroicons-chat-bubble-left-right" class="mx-auto h-12 w-12 text-gray-400" /> <h3 class="mt-2 text-sm font-medium text-white">No comments</h3> <p class="mt-1 text-sm text-gray-500">Be the first to comment!</p> </div> </div> Loads perfectly on dev enviroments on production the response of usefetch is working properly but comments render and after hydration it unrenders
27 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai how i can disable prerender in some pages?
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai Nice its working now but when i use it on a iframe <iframe src="http://localhost:3000/embed/test" allowtransparency="true" class="w-full h-96 bg-transparent"></iframe> its not transparent
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai what about settings transparent if route is /embed/test <script setup> const colorMode = useColorMode(); </script>
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai how i can remove the class "dark" thats being putted automatically in my html <html lang="en" class="dark">
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai using javascript
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
using javascript
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai how i can set html background to transparent
38 replies
NNuxt
Created by Cordobes on 3/27/2025 in #❓・help
Chat bot kapa.ai
@kapa.ai ok but that will apply to al pages i just want the background be transparent in a specific page localhost:3000/embed/test
38 replies