Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Custom Error Page in NuxtJS 3

How to custom error page as our own and make it dynamic for each response code.

not rerendering when changing ref value in async watcher

Hello! as you can see in the code I have a ref called "dashboard" which would change upon tap changes and get different results, however it doesn't re-render until I refreshh the page. how to fix it?...

Error when implementing nuxtauth: [Vue Router warn]:No match found for location with path "/session"

Hi everyone, I've been trying to use nuxtauth sidebase but as soon as I create the [...].ts file in server/api/[...].ts (the actual code inside this file and nuxt config below" . I got the error "WARN [Vue Router warn]: No match found for location with path "/session"". And I can't view the side on the front end. this is [...].ts import { NuxtAuthHandler } from "#auth"; import CredentialsProvider from "next-auth/providers/credentials";...

Import error

i have 2 absolutely identical mongoose model definitions, but one is causing errors and other - don't ```ts import { defineMongooseModel } from "#nuxt/mongoose"; export const User = defineMongooseModel({...

useServerSeoMeta ref/reactive vs await and one time rendering

Hello :), I read here and there (sorry, not very helpful ^^") that I should give directly the ref or computed to useHead/useSeoMeta/useServerSeoMeta so I'm assured the value will be updated to the right one. That being said, especially with useServerSeoMeta, not only it's server side but for SEO but even more og/twitter the first render matter AND it awaits on the useFetch to have the right value....

I get TypeError: Object prototype may only be an Object or null: undefined when deploying to Netlify

When deploying my Nuxt 3 app to netlify using the netlify_edge preset the deployment fails with the following error: ``` TypeError: Object prototype may only be an Object or null: undefined at Function.create (<anonymous>)...

About using callOnce

Hey all, Before the existence of the callOnce util, one of the recommended/suggested methods for initialising a store with data was to just simply call the action on app.vue (or layout.vue) which, according to my understanding, would load the data when loading the site for the first time, and then only call it again if we "hard refresh" the page. Now, can somebody clarify what is the difference between calling a store action directly inside app.vue's setup versus using the callOnce util?...

Props set on route contains an extra default key

Hi all I'm migrating a Vue 3 SSR project to Nuxt and I'm seeing a different behavior when defining the props on a route. e.g: ...

Dynamically add routes in runtime based on pinia store value

I want to dynamically add some protected admin routes on my app only for the admin user type. the admin user type is evaluated server side in a plugin. can i use router.addRoutes there? for my routes i dont use the file system routing but the router.options.ts method instead...

Can i use https://github.com/atinux/nuxt-auth-utils as auth for api nitro.

i have build fullstack app with nuxt and using nuxt auth utils to handle the authenticate system. but still wonder if my api was access from app like flutter or desktop app like tauri app and nuxt auth utils can handle the this to provide token for flutter or tauri so i did not have to build seperate api for those. thank you for any feedback.

useFetch doesn't send new query

Hello, unfortunately I couldn't really find a simple answer to my problem. I have this useFetch: ```js const {...

How to test middleware

Is there a way outside of testing for location headers to test middleware? I'd like to just test this small piece of middleware directly ```ts export default defineNuxtRouteMiddleware(async (to) => { if (unauthorizedPaths.includes(to.path)) return;...

Separate SEO and user rendering

Hello :), If I'm not mistaken, it is required to use await with useFetch (or useAsyncData) to ensure to have the best SEO possible or even just for the Social Media sharing to work properly. So, dumb question.... to have a snappy result, is it possible to render a different page for Google/Social Network and for the users ?...

useFetch, await, SEO and og

Hello all 🙂 I'm a bit concerned about some result I have using useFetch and useSeoMeta (or useServerSeoMeta), so I just want to confirm some stuff 🙂 Case 1 : useFetch without await and use(Server)SeoMeta...

Vitest not running in Docker Container.

Hey, I'm trying to run my tests inside a Docker Container using a Github action. If I try to run it outside of it, everything works fine, but if I run it inside a container, it is stuck at the point where the console logs:
RUN v2.1.5 /__w/daytistics/daytistics/frontend
RUN v2.1.5 /__w/daytistics/daytistics/frontend
...

Show stack trace?

Is there any way to see a stack trace for API routes? Front-end errors do show a stack trace, though the line numbers seem to be wrong, but on the server it just shows a 500 error in the console and on-screen, with no stack trace or information at all. Is there any way to see what file, line, or any indication of what the actual error is?...

Get SSE data from nuxt

I've written this code to retrieve SSE data, but it doesn't work properly. ```js // autre const output = ref<String>(""); ...

Page routing with multiple domain

How can I use multiple (sub)domains within a single Nuxt project (e.g. pages/<domain>/about.vue)? I know nuxt/i18n somehow does it but I was unable to figure out how exactly it does it.

devProxy with path both for regular requests and websockets

I am building a GraphQL application where the API endpoint is on /query. I want the devProxy to proxy regular requests AND websocket requests to the same endpoint. However, I can't figure out how to do this properly.
The below obviously doesn't work as is, duplicate key and such: ```json...

getting Nuxt context into a nitro route

Hey guys, I'm trying to create an adapter for our auth provider, logto, and it's proving to be a bit more difficult than I expected. Originally I was accessing our logto context via nuxtApp.ssrContext?.event.context.logtoClient unfortunately this doesn't work client sided, as you might expect, so I decided to create a nitro route for client requests to go through. ```typescript...