Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Nuxt 4 Migration, have build working, tests fail

I'm working on a migration to Nuxt 4, I've done the outlined file changes to be in the ./app directory. My build work and app seems mostly fine, tests however: ```ts Error: Cannot find module 'C:/Programming/leaderboard-site/app/vitest.setup.ts' Caused by: Error: Failed to load url C:/Programming/leaderboard-site/app/vitest.setup.ts (resolved id: C:/Programming/leaderboard-site/app/vitest.setup.ts). Does the file exist?...

How to cleanup/dispose resources in a plugin

Hello, I'm currently trying to implement PostHog in my website and I'm implementing it via plugins. Implementing the client plugin is easy, since it's just a .init call which loads their library, but using the serverside library is a little bit difficult, since you have to dispose of it when your server is about to be closed/destroyed. I know that with Vite, I can use the 'close' hook to dispose of it, but is there anything similar that I can do inside of a plugin, or what would the best way of doing it be? I want it to be a plugin since I want to be able to expose the instance to use it inside components and pages. I've seen others clearing resources in the app:rendered hook serverside since that's when pages are going to be rendered, but because the instance is not disposed off and is active when pre-rendering, the build process never finishes as it hasn't been properly disposed, and that hook isn't being called on prerender, so I'm a little bit clueless of what the best way of achieving what I want is....

Nuxt UI Pro license for open source project.

Hi Nuxt Team, I'm looking to migrate current Inspira UI docs from shadcn-docs-nuxt to Docus, but it requires Nuxt UI Pro. Since, Nuxt UI Pro is expected to be free of cost from September, how can I deploy without license till then....

Errors installing `@nuxtjs` modules

Hey Nuxters! Pretty new to Nuxt & Vue, coming from a React primary experience. But I am pretty stuck on these errors, and not finding much information about the package or errors in general, on Google, Nuxt GitHub, and even the module repo's I'm installing... So hoping someong might be able to help me out here. 🙏 ...

Module Nuxt v4 compatibility specification

Hey everyone, i saw that a lot of modules now use '>=3.0.0' to indicate compatibility with v3 and v4: ```ts meta: { compatibility: {...

Log requests and responses in a log file on the server

In summary, I am trying to log requests and responses to a file, a simple text file. This would be as simple as: ``` export default defineEventHandler(async (event) => { try {...

Content in server routes

Can I use the content plugin in server routes? Specifically, I would like to expose content collection as a JSON API.

Hybrid rendering and nuxt generate

The official documentation for routeRules says that hybrid rendering shouldn't work with nuxt generate [1] but it seems to work fine. Note that Hybrid Rendering is not available when using nuxt generate. routeRules: {...

<img> Image is gone after hot reload

Hey, im using a simple <img> tag ```html <img alt="Florian wandering in the mountains" class="w-full h-auto max-h-[600px] object-cover rounded-2xl shadow-2xl"...

Importing components in app.config.ts

Hello! I am developing @norbiros/nuxt-auto-form. Based on a zod schema I can generate an @nuxt/ui form. Currently I have a system where in app.config.ts you can customize default components like this: ```ts...

Cookie based auth with nuxt auth utils

I have a server which is sets a cookie on login and then that cookie is needed to authenticate users for other requests. I'm creating a frontent application with nuxt and just wondering what happens to the cookie if the server is sending the login request? Will the cookie be set for the user or do I need to make the call from client side?...

NuxtImage - Cloudflare

Hello i'm trying to use NuxtImage for the first time with cloudflare. While when in production everything is fine. I'm asking how can i make it works in localhost. The url of the image in production is: https://production.url/cdn-cgi/image/w=1024,h=1280,fit=cover/https://backendurl.com/uploads/img/PietroGroff_PLM_jpg_014.jpg ...

How to make PageCard clickable except the footer

I'm using PageCard with footer like below but I cannot do anything in the button. It always goto the card url ``` <UPageCard to="https://github.com"...

Hybrid rendering with static hosting

Hello 👋 I'm struggling to make the following setup work the way I envision and would appreciate it if someone with more experience could point me to the right direction. I have a statically hosted application on Amazon S3 and CloudFront. All pages are client-side rendered except for the landing page - because of SEO. This is my routeRules configuration from nuxt.config.ts.:...

How to Disable the default Nuxt 3 SPA Loading Template?

I added these two configs in nuxt.config.ts { ssr: false, spaLoadingTemplate: false,...

H3Error: Cannot find module 'entities/lib/decode.js'

I have a server side nuxt error that starts with "H3Error: Cannot find module 'entities/lib/decode.js' ", there is more to it, this isn't the only module that can not be found. I need help understanding why this is and how to resolve this. This doesn't occur on the local npm run dev or the production build that is run locally. This error only occurs on the server when I run the .output/server/index.mjs file. I use pm2 start to start the server....

Is it possible to create the project from the Node docker image?

Hey all! I am trying to start up a project without installing node & npm on my machine, so I'm using docker, but I get an error when running the npm create command. ```terminal maz@maz:/media/maz/SSD/websites$ docker run node:alpine npm create nuxt@latest frontend...

Nuxt Auto-Imports and TypeScript Server interactions with subfolders help

Something I am trying to understand about auto-imports and Nuxt's file structure: I have a class with functions inside app/utils/Services/storage.service.ts, and I don't have Nuxt auto-importing sub-folders in app/utils/. I should just be able to manually import it with no issues, correct? I can compile my app just fine, but my TS server seems to be having issues. Example screenshot attached of behavior I am seeing...
No description

extending a layer having pinia stores results into getActivePinia() as soon as i try to use a store

both, the parent and the layer have @pinia/nuxt installed. Still, i can only use stores in the parent but not from the layer. The stores are being found, they are just not usable.

Getting import error even if files there and also included in `nuxt.config.ts`

using bun as per as the quickstart guide in nuxt4 getting the following error:
No description
Next