Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Nuxt4 not responding with connect ECONNREFUSED nuxt-dev-3759.sock when using websocket on nitro

```ts ERROR [unhandledRejection] connect ECONNREFUSED nuxt-dev-4994.sock at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) at PipeConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17)...
No description

Components preview

I am creating a custom nuxt module with some basic components. I have @nuxt/content docs website with @nuxt/ui, and I want to easily write a component code in the docs inside and then have it displayed nicely with the code with proper highlighting and working component on the other side. Nuxt ui docs have something similar, but it is very complex and I don't want to copy it, nuxt content docs have some too, but it is used only to showcase markdown rendering. Any ideas/suggestions how to do it?...

Config cache using routeRules without effecting inner paths

I'm trying to cache responses on the client with max-age 30 and stale-while-revalidate 30. The endpoint is /api/featureA/<id>. The UI page that makes the request for this endpoint also makes additional api calls to /api/featureA/<id>/something?param=value. How can I config routeRules that catches only /api/featureA/<id> but not handling the inner one?...

Missing code highlights

Hello! When I write
ts
ts
inside my app nuxt content docs it is colored properly, but when I do something like
const code = computed(() => {
return [
'
const code = computed(() => {
return [
'
ts',...

Help in migration to Nuxt 4, error in testing part

Hi, I havent found what is the correct architrcture for test folder and what would have changed in v4. After updating folder architacture the test completely fails with this error No test files found. You can change the file name pattern by pressing "p" include: */.{test,spec}.?(c|m)[jt]s?(x)...

nitro autoSubfolderIndex:false preview 404

When i set nitro autoSubfolderIndex:false ,and use generate and perview,in localhost:3000 any routes always 404. What else do I need to configure😢 export default defineNuxtConfig({ ...
No description

How to access environment variables of .env in pinia store in Nuxt 4

Currently in .env
TEST_APIKEY="TEST"
TEST_APIKEY="TEST"
...

Detected HTML unplugin-vue-i18n

```vue <script lang="ts" setup> const { t, locale } = useI18n(); <template> <h1 v-html="t('title')"></h1>...

WebStorm Syntax problems

Does anyone else have such major syntax problems with Jetbrains' WebStorm IDE? It often gives me syntax errors in places where there aren't any, and when I hover over them, nothing happens, and the website works fine. It's only displayed incorrectly in the IDE. I've had this problem for months, I update my IDE regularly, and somehow it won't go away.
No description

Nuxt Image IPX issues with Nuxt 4

Recently migrated an electron + nuxt project to Nuxt 4. SUddenly, after migrating, moving files, etc.. Nuxt Image, more particularily IPX cannot load files. On the browser, I get a 404 on every file from the public folder (located at app/public) (IPX_FILE_NOT_FOUND). I have no idea what could cause this. Tried switching the dir in the config of nuxt image to public, ~/public, app/public without success. Here is the repo where the code and structure is: https://github.com/TheDogHusky/nekoviewer...

Nuxt auth utils examples

Does there exist an nuxt auth utils example with a basic jwt token? I'm setting up a authentication flow with my own custom backend using asp net core identity

Nuxt Middleware testing

Is there any way to test middleware (specifically redirecting from unauthorized routes based on a user attribute. I am working with Nuxt Test Utils in Nuxt 4.0.3 In my middleware I have:...

How is `statusMessage` different than `message` in createError?

Hello, i am having really hard time of understanding statusMessage and message differences, even i don't pass the 'message' property, 'message' becoming the statusMessage, and also i know that it's also shown in HTTP header so it's not suitable for longer messages. So i wanted to completely rewrite my code to use message only, no statusMessage But then i had this issue, in server:...

Dashboard Template long loading times

Hey everyone, I've set up the Nuxt UI Pro Dashboard template and am encountering an unusual performance issue in development mode. The page's initial load is very fast (around 0.7 seconds), but sometimes after a refresh, I get a white screen that lasts between 5 and 20 seconds....

useFetch reactive triggering twice

I'm using vueuse useRouteQuery to get page and limit values from the query params. For the first page, those params don't exist so I have defaults setup. I'm then passing those to the useFetch query object. So the problem occurs when I'm on the first page and go to another page, I get 2 network fetchs to the api, the first one gets cancelled and the second one succeeds but the useFetch gives me the following error:
<no response> Request aborted as another request to the same endpoint was initiated.Caused by: AbortError: Request aborted as another request to the same endpoint was initiated.
<no response> Request aborted as another request to the same endpoint was initiated.Caused by: AbortError: Request aborted as another request to the same endpoint was initiated.
If I'm on a page other than the first where the params are in the query and go to any other page (even the first page) it works perfectly....

I enabled cache with nitro but don't receive the cache-control header in response

I enabled cache for svg images through routeRules in my nuxt config ```typescript const weekInSeconds = 60 * 60 * 24 * 7 export default defineNuxtConfig({ routeRules: {...

Nuxt content shiki themes only ever uses the default

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

NuxtImage not working as expected with Sanity

If I set the provider to sanity in the image config then for usage such as: ```js <NuxtImg :src="item.image.asset.url" ...

Shadcn + nuxt v4

Anyone has had any issues with shadcn, installing modules seems to throw errors I am not sure what it is related to.
No description

Nuxt 2 - Removing vuex-persist

I have an SSR Nuxt 2 app that uses the store. I currently have vuex-persist as a plugin that runs on client side. I wanted to change the default of one of the values from true to false by editing store/index.js, as well as adding a new value. After doing that, when I refresh the page it seems the new default value and the new value is there, but the new default value takes over after the page loads. I found that in the browser localStorage, the old default is still there and the new values are absent. In my mutations, I also create/update a cookie of the same name. Then, use nuxtServerInit to update the store with what is in the cookie. This syncs up the store on page refresh. Reviewing this process...I'm starting to think that my vuex-persist plugin is unecessary to have? It doesn't seem to be providing any benefit, and I think it is what is causing my problem with adding/updating default values in my existing store. Having the client restore the store based off of what vuex-persist put in localStorage seems unnecessary when I'm already using nuxtServerInit and the cookies I'm setting. ...