Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Do I have to specify in the nuxt config files if I am using the app dir?

I am using Nuxt 4 and was wondering if I have to specify the src dir in the NuxtConfig file if the said file is in the root of the project and I am using the app dir structure.

Build Failure After Upgrading from Nuxt 3 to Nuxt 4 in Docker (Linux) – Rollup Module Error

I’m encountering a build failure after upgrading my project from Nuxt 3 to Nuxt 4 when building in a Linux-based Docker environment. The project was building successfully with Nuxt 3, but after the upgrade to Nuxt 4, I’m seeing errors related to Rollup and native bindings. I need help identifying the root cause and finding a solution to successfully build my Nuxt 4 project in Docker. Issue Description After upgrading from Nuxt 3 to Nuxt 4, the Docker build fails with the following errors during the npm install step, specifically when running nuxt prepare:...

Hook after module installation

Hi! I'm working on a new version of gsap nuxt module, and I want to add this new feature: After installing the module, the terminal asks you if you want to include some plugins in your configuration....

Nuxt 4 build but doesn't work

[request error] [unhandled] [GET] http://10.244.208.129:3200/ Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/.output/server/node_modules/unhead/dist/server.mjs' imported from /app/.output/server/chunks/routes/renderer.mjs at finalizeResolution (node:internal/modules/esm/resolve:275:11) ... 6 lines matching cause stack trace ... at ModuleJob._link (node:internal/modules/esm/module_job:175:49) {...

Build hook - dev only

I am trying to create pre-build script for my Nuxt app. So I have chosen defining build:before hook in nuxt.config.ts. The reason is copying files from mother dest. How can I only run this hook in development mode (npm run dev)? import.meta.dev is undefined there....

Nuxt Module require other libraries without installing them

I am creating custom Nuxt module and I want to make it depend on zod and @nuxt/ui, but not install them. I don't want to be something like @nuxt/ui that installs @nuxt/fonts instantly. I want that, because I don't want to release often version updates when for example new version of zod is released. Is it even possible? Are there modules that have optional logic when other is detected?...

Nuxt Content: Use custom subdomain in sitemap

Hello, I'm using the nuxt/content and nuxt/sitemap modules. I've got a list of markdown files under the directory "content/publications" which contains meta data for some PDF files. The PDF files are hosted under a separate subdomain (media.mydomain.com). The metadata for the publications are serverd under mydomain.com/publications. ...

Why my Nuxt-Icon color cannot able to change color?

I have tried every method such as add code "fill",add file"app.config.ts",or add "fill= currentcolor" in svg,but the icon color no change in black . Can anyone tell me what causes this? The version of Nuxt-Icon is v1.15.0 ....
Solution:
Hi @cocoa-c. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

Does useHead not exist in Nuxt 4?

If it does, what is the correct syntax for using it in the app page, I just updated Nuxt 3 to Nuxt 4 and am seeing a TS error with the useHead. What am I doing wrong?

Global types failing

I'm getting this error Write global types file failed. Please ensure that "node_modules" exists and "vue" is a direct dependency, or set "vueCompilerOptions.globalTypesPath" in "tsconfig.json" manually. I have tried suggestions of running npm install vue which didn't help. I also set the vueCompilerOptions.globalTypesPath in my tsconfig.json and that didn't seem to help. I'm new so sorry for my newbish question, what am I doing wrong....

how can i start a v3 nuxt

how can i start a v3 nuxt

Nuxt UI Pro free

Hey there! Is there a way to start using Nuxt UI Pro in production for free? Or waiting for septembre is required ?...

Nuxt random crashing

how can i stop nuxt doing this ERROR [unhandledRejection] read ECONNRESET 20:11:41
at TCP.onStreamRead (node:internal/stream_base_commons:216:20)...

Readonly reactive variables in pinia store

I am trying to mark a reactive variable in my pinia store as readonly() so it's only changed via setter but doing that yields a warning as [Vue warn] Set operation on key "value" failed: target is readonly. on initial page load. How can I solve this?...

Unable to view the pages/index.vue

I am new to nuxt. I just created a new project but I am unable to view the home page even after adding <NuxtPage /> in app.vue...
No description

Zod auto imports

Hi! I am using zod4 and nuxt. I want to do something like this: ```ts import * as z from 'zod' export default defineNuxtPlugin(() => {...

Nuxt content markdown validation

Is there a way to validate nuxt content .md files based on the collection schema ? So far, ive added categories: z.array(z.enum(VALID_CATEGORIES)).optional(), to schema of my collection, but when writing the content .md file, i can write whatever i want, i would get no warnings about it and it would still work correctly, even tho im guessing it should not....

PrimeVue components no longer auto-imported with Nuxt 4

Newbie here. First project. 1 week old. Just upgrading to Nuxt 4. In app/components/nav/leftmenu.vue I have a simple template using the <Menu> component from PrimeVue. It used to work with Nuxt 3: ```...

Nuxt V4 npm run preview error can't find module "E:\WebDev\My-App\.output\.output\"

Hello, i upgraded my project to nuxt v4 but update the update this error occur. the console log show like this: ``` ℹ Loading .env. This will not be loaded when running the server in production.
ℹ Starting preview command: node .output/server/index.mjs
node:internal/modules/cjs/loader:1404...

Migrating from nuxt V3 to V4: DOM doesnt update after HMR

Hello, i upgraded my nuxt 3 project to nuxt 4 and after this, my dom doesnt refresh after HMR. I get console feedback in debug telling me that hmr happened but nothing.