Questions tagged [nitro]

Use [nitro] for questions about the Nitro Server Engine for Nuxt.js

Nitro is the server engine for Nuxt.js

40 questions
3
votes
0 answers

Nuxt server route works locally, but not on remote Vercel Edge server: 404 Status Code -- why?

I have a Nuxt3 app using server routes. The app works fine locally. However, after deployment to Vercel using vercel-edge preset, one of the routes for some reason is a 404. When accessing this URL: https://modernmedtalk-dosstx.vercel.app/test and…
redshift
  • 4,815
  • 13
  • 75
  • 138
2
votes
0 answers

Why is useFetch returning HTML instead of a JSON object following a request to api?

I am making a request to an API route, and the useFetch() method is returning HTML instead of JSON. I have attempted to comment out code blocks and manually test everything step-by-step to no avail. Is there something I am doing wrong? The API route…
Hayden
  • 779
  • 10
  • 18
2
votes
2 answers

How do I process form data for a file upload as FormData on the server side of a Nuxt 3 handler application

I am sending data to a Nuxt 3 server side defineEventHandler. The data is correctly sent to it as a multipart/form content-type. However, I want to get the data in the FormData sent to defineEventHandler but when I use readMultipartFormDat(event) to…
BreenDeen
  • 623
  • 1
  • 13
  • 42
2
votes
0 answers

Nuxt3 doesn't hot reload on content change, but does after I rename the component

First and foremost, using Windows. There are no errors in the console regarding hot-reload, and the page works just fine when I refresh it manually. Currently editing a file that's under ./components/Navigation.vue. I'm using more or less default…
Dāvis
  • 51
  • 6
2
votes
2 answers

Nuxt3 + Vite + Nitro HMR cache issue

I have default project setup getting from nuxt3 document. I'm talk about this starting point : npx nuxi init . The project is up and running on my local machine. Unfortunately output is not up to date in the devtools. For example I…
Yasin Yörük
  • 1,500
  • 7
  • 27
  • 51
2
votes
0 answers

Is there a way to access data from a Nuxt 3 server api route inside of another server route?

I'm working on a Nuxt 3 application where I need to generate a sitemap dynamically from a CMS using the method described for Nuxt Content. I'm using the built in /server/api/ directory to get this data for the rest of the app. My sitemap.xml.js file…
1
vote
0 answers

Nitro overwrites staticwebapp.config.json when preset:azure

I have a Nuxt 3 application that I deploy to Azure Static Web App service in Azure DevOps pipeline. After reading the configuration I've added some custom auth config and allowedRoles. The problem I am facing is that the staticwebapp.config.json…
1
vote
1 answer

Nuxt3: /server directory structure. Dynamic Nested API routes

In Nuxt3, I am using useFetch to call this url endpoint: company = await useFetch(`/api/company/${companyKey}/profile`) Notice the extra /profile at the end? How can I organize my /server directory to cater to a url endpoint of this structure? For…
hyang123
  • 1,208
  • 1
  • 13
  • 32
1
vote
1 answer

How do I set proxy with baseURL with Nuxt3 and Nitro config

I'm trying to proxy requests so that when I call http://localhost:3000/basePath/api it requests http://localhost:8080/api. I'm using the experimental routerules from Nitro to do this: export default defineNuxtConfig({ nitro: { …
Xavier FRANCOIS
  • 652
  • 4
  • 15
1
vote
1 answer

Cache Issues with Nuxt3 in Dev

i'm having trouble developing with Nuxt3, the problem is that sometimes edits in the code are not visible, it seems that Nitro caches something and I need to restart the server in order to see the updates. The most effective example is when I…
sintj
  • 804
  • 2
  • 11
  • 23
1
vote
0 answers

what is the difference between nitro compression and vite compression in nuxt3

For SEO purposes I want to zip and distribute my files. Both vite and nitro have compression options. What's the difference between the two? This is my nuxt.config.ts export default defineNuxtConfig({ nitro: { compressPublicAssets:…
Lawyer Kenny
  • 363
  • 4
  • 16
1
vote
1 answer

Use formidable's PersistentFile with FormData and fetch

I'm running a small api with nuxt3/nitro. It works like a proxy between my webapp and my regular api. So my nitro api receives files, I read them from the request using Formidable, and they get saved in formidable's PersistentFileinstances. Now I…
Bruno Lamps
  • 544
  • 6
  • 27
0
votes
0 answers

nuxt3 server routes rewrite

I have a server route that reasons that I won't go into needs to http://my-domain.com/~/images/filename.jpg I have created the folder structure with a folder name ~ and all works as I would expect however I cannot add this code to my repo as it…
Udders
  • 6,914
  • 24
  • 102
  • 194
0
votes
0 answers

Nitro DB initialization pattern using plugin, does this make sense? (nuxt, mysql)

does the concept of initing a db connection then attaching it to the nitroApp context within a plugin make sense? usage is from api/hello and that does a { db} = useNitroApp() this does work, im just wondering if this is a good thing to do or is…
user1088963
  • 197
  • 1
  • 14
0
votes
0 answers

How to properly deploy a project on Nuxt3 + Nitro + Docker + Nginx?

So, there is a website on Nuxt3 (+Laravel API) that used to run on Vercel without any issues, and Google PageSpeed scored 85-90 points. Now, the task is to deploy the entire infrastructure on Docker. As a result, there are about 10 containers on a…
1
2 3