Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Nuxt Studio v1-alpha: document is not defined

I'm trying to preview Nuxt Studio locally, but get document is not defined regarding this line const Js = document.createElement("i"); reference to this file: node_modules/nuxt-studio/dist/app/shared-CYxp8gik.js at line 1728:11...

defineMeta for layouts

is it possible to define middleware for a layout directly?

Rendering the error page triggers Nuxt server plugin to execute twice.

When accessing an unregistered route page or triggering a Nuxt error, which renders the error.vue page, the server-side Nuxt plugins execute twice. When my plugin contains multiple asynchronous functions, this significantly impacts the page rendering speed. How should I resolve this issue?
No description

Bug: Updated to Tailwind v4 in my Nuxt app, background gradient bug that appears only on iOS Chrome

The styling gets messed up but ONLY on Chrome on iPhone (iPhone is running iOS 26). This same issue does NOT happen on Safari on iPhone. Here are the Tailwind classes used on this text bg-gradient-to-b from-white/85 via-white/85 to-white/70 bg-clip-text text-transparent. I just migrated to Tailwind v4. This was not an issue on v3. Also, this bug does NOT happen on initial page load which gets loaded as an SSR page BUT afterwards the website works as a SPA and when you navigate to any other page, the Tailwind styling related to any kind of background gradient colors goes crazy....
No description

Build fails after updating to Nuxt 4.2.0

Anyone have problems buildin with 4.2? We're building in docker but the build step fails right away with this error message: #12 6.919 ERROR ✗ Build failed in 42ms #12 6.919 #12 6.920 #12 6.920 [nuxi] ERROR Nuxt Build Error: Build failed with 1 error:...

Deploy Nuxt on new Deno Deploy

i'm trying to deploy a nuxt 4 app on new deno deploy with the classic version it works...
No description

[Solved] Creating New Project Keeps Failing

I have been trying to create a new Nuxt project (both with npm and pnpm) and each time it is failing with the following error in terminal .... Could someone explain to me where I am going wrong? (I even tried following the setup guide in resorces with the same result) ``` [13:47:05] ERROR Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory. ...

localStorage.getItem is not a function

``` [CAUSE] TypeError { stack: 'localStorage.getItem is not a function\n' + 'at getTimelineLayersStateFromStorage (./node_modules/@vue/devtools-kit/dist/index.js:2272:30)\n' +...

Tailwind v4 not working with nuxt 4.2.0

Hi, Tailwind v4 isn't working with nuxt. I tried the steps in the official tailwind documentation https://tailwindcss.com/docs/installation/framework-guides/nuxt but it didn't work I also tried using postcss, it threw an error an told me to install tailwindcss/postcss, which I did but that also didn't work...

Custom page file name prefix that should not affect generated route

Hey, I've been building quite a bit with Nuxt and the site has gotten big, so i have quite a lot of index.vue files. I was wondering if i can somehow set up a file name only prefix, like users:index.vue / users:[id].vue / roles:index.vue etc. Fuzzy search with directory in IDE hasn't really been helpful. Is there something built in or do you have a build time hook suggestion?

The components are not rendering properly | Nuxt Content

I'm building a kind of CMR and I want it to include a documentation section, so I decided to use https://content.nuxt.com/templates/docs and based it on their GitHub repository https://github.com/nuxt-ui-templates/docs/tree/main . I adapted the project so that all the documentation is located under the /docs route (that was the only major change from the original version.) Everything works fine, but the only issue I'm experiencing is that in the .md files, a couple of components don’t render correctly, and I can’t figure out why....
No description

How to handle large Markdown files in Nuxt Content 3?

I'm currently migrating my app from Nuxt Content 2 to Nuxt Content 3 and ran into a problem. I have a large Markdown file (about 13,000 lines) that contains the full documentation of my API (I can't split it - it needs to be one page so users can use CTRL+F, etc.) There was no issue with this file in Nuxt Content 2, but in Nuxt Content 3, when using better-sqlite3, the file simply doesn't work. In the console, I get these errors:
[unhandledRejection] near "AqVXMov94MXnIeqdox4wPbKzA6p3XzCoSV2agF4I7jI": syntax error
[unhandledRejection] unrecognized token: "\"
[unhandledRejection] near "AqVXMov94MXnIeqdox4wPbKzA6p3XzCoSV2agF4I7jI": syntax error
[unhandledRejection] unrecognized token: "\"
...

yarn generate not creating _nuxt directory

Hi everyone, I was wondering in what occasions a 'yarn generate' would not create an _nuxt directory? We currently have a gitlab CI/CD pipeline, in which we build our nuxt app 3 times for 3 different locales. Sometimes the _nuxt dir is not created, even though the build does not contain any errors. It also occurs sporadically on different locales, so the problem is not consistent which makes debugging difficult. The latter also makes content or environment issues unlikely. We also run the same pipeline for our acceptation environment, which runs fine and also correctly creates the _nuxt dir consistently for all locales....

Auto importing in unit tests

In Nuxt 4.2.0 it's great that we have auto-imports, but it doesn't work in the unit tests. So if I e.g. have app/utils/helper.ts it works great using it across the Nuxt application, but it will fail in the tests if it e.g. uses another util inside that is auto-imported. Isn't there some way to have the auto-imports be available in the test/unit as well?

index.html not created when running npm run generate

// https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ compatibilityDate: '2025-07-15', devtools: { enabled: true }, srcDir: './app',...

Nuxt modules with layers

Is it possible to use layers with modules or creating a lmodule with layer? Or is it possible to give configuration to a layer like we can do for modules?

Unmounting Hooks

Hello Kapa When a component is Unmounted, are the hooks he was using removed/discard/unregistered automatically ? Or do I have to do it manually in an onUnmounted() ? thx...

Nuxt Security routeRules csurf

I am using csrf with nuxt security, and there a document for per route settings using the "csurf" config with route rule, but in nitro route rule there are no object for "csurf". could you help me out guys ? Ref:...
No description

Auto import breaking

I have my type definitions inside shared/types, and my enums are located in shared/types/enums. When I reference something like FooEnum (from shared/types/enums) inside a type definition in shared/types, it doesn’t auto-import correctly. If I manually import it, the app’s auto-import system breaks completely....

Image Rendering Low Resolution

This is probably a very easy fix but I don't know what to do. I'm using Nuxt 4.1.1 Having an issue with Image Rendering in which my images are loading in lower quality for some users (even if SVG) - images are also lower quality zoomed out than zoomed in...