Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

How to send back an image from nuxt3 api endpoint?

I want to secure my images that I send back, so I send it back through an endpoint, but when I do that, chrome can't read it. It sees like 2.4mb being transferred, but the resource size ends up being 0kb. I try this, and it works if I visit it directly in browser link, but not when I call it from JS. What am I doing wrong? I am calling it using $fetch, but I can still see it in network tab, the response is not showing correctly. ```...

Nuxt Server: Rewrite

Is there something like https://nextjs.org/docs/app/api-reference/functions/next-response#rewrite for nuxt, so we can build Multi-tenant Custom subdomains with nuxt & vercel (Next example: https://www.youtube.com/watch?v=vVYlCnNjEWA) Thanks in advance!...

ERROR [unhandledRejection] near "[{"name":"Clinical Pathology","questions":[]": syntax error

```json { "university": "University of Leeds", "year": "2", "modules": [...

How to set production port?

npm run build always builds on default port 3000 despite setting the PORT .env variable, and even getting help from chatgpt that said to set it in runtime config ``` runtimeConfig: {

public: { port: process.env.PORT || 3300...

const { data: home } = await useAsyncData('leeds', () => queryCollection('uniofleeds').first())

Argument of type '"uniofleeds"' is not assignable to parameter of type '"content"'. import { defineContentConfig, defineCollection } from '@nuxt/content' import { z } from 'zod' ...

Use Nuxt with Express.js instead of nitro

Hello everyone, I really need some help I dont know how many hours I have spent on this simple task and yet I can not fix it. I want to use nuxt with express.js for the back instead of nitro but I want of course to keep nuxt's auto routing for the front end. I have made a project , added this to nuxt.config.ts ...

moving from supabase realtime to my own pg notifications + websockets?

Hi, currently I'm relying on supabase realtime which is very very iffy constant random disconnections and errors even with a file that should handle that. So I want to try to build out my own websocket handling. I have some experience with socket.io. Most of my websocket usage currently is subscribing to tables for changes client side to handle data being changed. What would moving to make my own websocket handling look like?

How to access server context / global state from a websocket handler?

I have this simple websocket handler defined at server/routes/websocket.ts, I've already enabled the nitro.experimental.websocket flag in nuxt.config.ts and it works fine. ```typescript export default defineWebSocketHandler({ open(peer) {...

Any way to speed up dev server build time on NixOS?

Trying to debug an issue with either Nuxt or how Nixpkgs provides the Node binary, and because of that, dev servers take up to five minutes to load. Is there any way to debug these issues beyond playing around with Node's inspector? This issue also seems to be plaguing bun. https://github.com/nuxt/nuxt/issues/28023...

What is the proper way to use the shadcn-vue sidebar?

I was a little surprised to see sidebar isn't integrated into layouts. Do I lose anything by not using layouts? Should I follow the shadcn-vue docs to a "T"? https://www.shadcn-vue.com/docs/components/sidebar.html...

nuxt ui carousel + nuxtimg preload images

Hi, I'm using nuxt ui carousel (embla carousel) to display nuxtimg images. however I filter my list of items i put into the carousel based on the variant selected of my product. so when i change product the items list will contain some new items and it seems that those new images are then downloaded. is it possible for me to somehow preload all images for my variants even if not in the items array yet?

Monaco Editor fail to load

Hi everyone, I tried to find an answer, but I can't make it work after hours of trying 😦 Subject: Install and use the Monaco Editor (I used this module https://nuxt.com/modules/nuxt-monaco-editor)...

Supabase asking for env keys when adding server/api folders

Hi, I was correctly working with supabase until I created those endpoints, now I get this error Your project's URL and Key are required to create a Supabase client! Check your Supabase project's API settings to find these values https://supabase.com/dashboard/project/_/settings/api I have the .env files like this ...

NuxtJS not update after deploy on production server

I have experience after build nuxt with command npm run build on production server sometimes need to open network devtool network and disabled cache then reload so my webiste is change, is there better way to detect the new version of build to when it change will automatic pull the new build form server

nuxt mdc adding margin to top how to remove it?

"<MDC v-if="hasImportantNotices" :value="noticeContent" class="border-4 border-red-700" />" I'm rendering MDC content like this '"::callout{icon="i-lucide-triangle-alert" color="warning" to="#"} This is a callout with full markdown support. ::" that is the content it's rendering. but it's for some reason adding margin to the top which throws off my page. how do i ensure it doesn't do this? I tried to add class="!m-0" but it didn/t work...

Dynamic route change without refreshing the page

In Nuxt, I have a dynamic route page like /[category].vue. How can I prevent a full page reload when navigating from one category (e.g., /iphones) to another (e.g., /tablets)?

Using layouts for authenticated pages?

Hey, for the nuxt experts, are layouts a good way to handle authenticated pages? Aka redirect to login page if not authenticated in certain pages. I know that in some frameworks, using layouts are not the best idea, for instance, in svelte, there is this weird issue that if you use layouts, it only checks for authentication the first time you enter a page using the layout, so for instance, if you enter page A, then go to page B and sign out, you can go back to page A and you will still be authenticated (kinda) and be able to do actions while not being authenticated......

[useAsyncData] handler must be a function.

I am trying to write an api utility function that wraps useAsyncData. I don't know if that idea is fraught with peril to begin with, but I am running up against an issue since this function is running in a utility within a setup store in pinia. The error I get running the following code: ``` const { data } = await nuxtApp.runWithContext(() => {...

I'm getting a weird error with no line numbers or trace when starting dev server

error: unknown command '_dev' How can I get more debug/trace information about where this is coming from?...

PWA In NUXT

I need a quick suggestion about implementing PWA in NUXT. Has anyone implement one before and what modules and plugins are available for it