Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

setup nuxt studio

can you walk me through setting up nuxt studio? I deployed my site via github to render.com. what steps do i need to ensure in my project so i can use nuxt studio

htmlAttrs.lang not working

Hi, I have a weird bug, not sure if it’s worth opening a GitHub issue for it. In my nuxt.config.ts, I’m setting the HTML lang="fr" attribute like this: ```ts...

How to call server APIs from unit/e2e test?

I have a composable (among many others which I'm going to want to test) which call useFetch, $fetch, etc... Ideally I want to test exactly what those functions do instead of making isolated $fetch calls, but I can't figure out how to setup the server or how to mock the functions that call its endpoints. So far I have @nuxt/test-utils/e2e setup to make calls to a dev server I run separately with my test database. The problem lies in wanting to make my composables talk to that server, as by default it'll just try to make calls to /api/blabla... without a base URL. Is there a better way to do this without needing to refactor too much code, or am I just missing a small piece here? Thanks a lot...
No description

Understanding useSession behavior in Nuxt with Better-Auth and NuxtUI

I'm using Better-Auth for authentication and ran into some confusion while trying to implement a simple feature: showing a Login button in the menu when the user is not authenticated, and Sign Out when they are. I'm also using NuxtUI for the UI components. After a lot of trial and error, I got it working with the code below, but I got questions: 1. Why does using await to useSession() fix it?...

Cant acces nested page with i18n and custom route name

Hey everyone, I'm running into a strange routing issue in my Nuxt application and could really use some help. The Problem:...

Get DOM-Element from Nuxt-UI elements

For example, i have <UInput ref='refInput'/> and wich type has refInput = ref<>(null)?

nuxt ui icons local bundle do i also need to install the icon library locally?

So with the nuxt ui icons im using " icon: { clientBundle: { // scan all components in the project and include icons for fast load speeds scan: true, },...

Client Lazy Data Fetching

What is the difference between const { status, data: posts } = await useFetch('/api/posts', { lazy: true }) and useFetch without await?...

How to use Lazy component with render function

I'm trying to Lazy Hydrate components with h ```js import { LazyComponent...

hub

Nuxt Hub how I can use crypto.createSign as I get "[unenv] crypto.createSign is not implemented yet!" 😐

custom `name` parameter for Nitro `defineCachedEventHandler()`

I want to use the current language as a parameter sor my API call. Obviously, I want my cache strategy to follow these different languages possibilities: ```js import { fetchSuggestions } from '../utils/suggestions' ...

code being executed when running npm run build

maybe this is a silly question, but when I run the npm run build command I see that the code in my nitro plugins is being executed. Is this expected? Where can I find more context about this behaviour? :pepethanks:

usetoast callback when toast clears

When using useToast and creating a dynamic toast with toast.add is it possible to have a callback that triggers a function when the dynamically created toast clears?

Deploying to Cloudflare - cant see /manifest.json

Ive got a static site that im trying to deploy, ive got ssr: false because were going on cloudflare, ive got my manifest.json in root public directory. it works locally. cf is built with npm run generate and told to serve from dist - but i get a 404 on the manifest. reasonably simple project:...

tailwind

/layers not apply tailwind v4?

auth for specific routes

I have pages like /account/ and /admin/ i want to protect so i made a middleware ```'/account/': { meta: { requiredRole: 'user', middleware: ['auth'] }, }, '/admin/': { meta: { requiredRole: 'admin', middleware: ['auth'] },...

<ClientOnly> vs .client.vue

Yo Kapa Difference between naming a component something.client.vue and wrapping it into <ClientOnly> in the parent...

Redirect 404 pages from a middleware

Hi there, i'm currently working on my company's new website with Nuxt 3.17. This new site will be AB tested and some of the old site's pages won't be implemented from the start in the new version. I need to detect routes that are 404 in the new website and to redirect these to the equivalent page on the old website... ...

Size of modals

How can i define the width of the modal component?

Important! Can Sanity documents be used to generate and manage Nuxt Pages?

I have successfully accomplished this feat…sort of but I still see some issues that I wonder if anyone knows how to get over this. The pages are sanity documents with a pagePath or slug. For instance “/”, ”/about” I have a […slug] page which is assigned a sanity-page-middleware ...