Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Dealing with useFetch / useAsyncFetch with headers and baseUrl

I am a bit of a newbie to Nuxt. I want to create a custom fetch but with the love that comes with useFetch in terms of caching and the other bits of extras. If i use useFetch, i can load it in setup, but not as a user action. For the user action, i would need $fetch if i am understanding it correctly. I've read the documentation, created my own custom fetch. But would love to try extend the caching ability. Is this possible? I'm considering using Pinia as a "cache" but not sure if this is the right approach....

Problem getting data from Pinia

I have a component used within my layout that is responsible for setting user information. However, when I try to access this user info from another component located deeper in the component tree, it returns null. ...

Generating dynamic composables from a module

Hello, I'm trying to create a module for internal company use that will automatically generate server/api routes and corresponding custom useFetch composables to integrate with our internal API's. This is a rough sketch of what I want to accomplish but I'm kinda stuck on how to dynamically generate my composables. The module creation documentation is very sparse and without much experience in building modules I'm at a roadblock right now. Anyone who has done something similar before and can provide some guidance?...

Nuxt Content Directory indexing too much?

According to https://content.nuxt.com/usage/content-directory the way to organise the content directories follows this example: content/index.md / content/blog/index.md /blog content/blog/hello.md /blog/hello ...

Nuxt UI SelectMenu Recursive

I may be doing something wrong for sure but I'm missing where is the recursive update in this component. When I open the USelectMenu it gives me this error: `[Vue warn]: Unhandled error during execution of app errorHandler...

Nuxt websocket proxy is not working

i am trying to set the nuxt proxy to forward websocket requests but it is not working. i see this github issue: https://github.com/nuxt/nuxt/issues/28098 any idea what can be a workaround? this is prod deployment and i am stuck. using latest nuxt 3.13...

How would you implement showing a success message after posting a form?

I have this use case: 1. User navigate to /books/create which displays a form to create a book 2. User fills the from and submits the form 3. In case of a successful submit, the user gets redirected to /books/:id and a success message is shown at the top. ...

Can you deploy Nuxt as SSR on Cloudflare pages?

I tried deploying Nuxt on Cloudflare, but the SSR seems not to work. UseFetch doesn't work on the server, but only on client. So the question is, does Cloudflare support ssr or is it only for client side apps?

nuxt ui

Hell0o guys i am getting error when i install nuxt ui in my nuxt basically i am getting tailwind error has anyone face that and help me how to solve this
No description

H3 doesn't support body content on SEARCH method?

I'm trying to proxy an API, by following Alex's video on proxies. I want to be able to use the SEARCH http method. I tried using routeRules, which works, but it doesn't seem to pass in the body to the destiny endpoint, returning unfiltered data. ```js...
No description

[vite-node] [plugin:vite:vue]

I seem to be randomly getting the following error and I have no idea how to debug this. The component it's referencing is definitely NOT producing the error (It's from shadcn-vue) ``` ERROR [vite-node] [plugin:vite:vue] [VITE_ERROR] /components/ui/tabs/Tabs.vue <br><pre>&lt;script setup lang="ts"&gt; import { TabsRoot, useForwardPropsEmits } from 'radix-vue'...

I created middleware to use in some pages, but im checking and taking time to run

what cand i do fot this? ```js export default defineNuxtRouteMiddleware(async (to, from) => { if (!process.server) {...

How to disable SWR if a route has a querystring?

We are building an online store and have category pages that list out products. We want the main initial category page to use SWR for speed and SEO. These category pages have filters, that are applied to the querystring when selected. We don't wish to SWR a category page with filters applied in the querystring, instead we'd like them to use CSR. I can't see how to use routeRules or middleware to achieve this....

Missing cookies in request from server

Hey I am trying to make ofetch call from the middleware to preload data into the store. Problem is that the call should include also cookies with auth information but as i am trying to console.log headers of this request made on server, there are no headers at all

Hydration loading

Hello 🙂 I understand that when the server is done loading, you can display somethign while the client is downloading the content using either <ClientOnly> or OnMounted() Is it possible to display something while the server is loading ? For exemple, to exaggerate it, if I put a 10 seconds waiting for an endpoint to answer, I will have to wait for 10s to display anything no matter what ?...

Expose endpoints only internally

Hey, for our use-case I would like to prevent users from directly accessing the API. I would like to make it so only nuxt is able to access the nitro endpoints and return a 403 if someone directly tries to access them.

Nuxt / ESLint and VS Code

Does anyone have the new ESLint module / flat config working in VS Code? I've been trying with the latest Nuxt and ESlint extension (3.10 and also 3.13) in VS Code, and it doesn't seem to work. I have an error in the ESLint output window in VS Code
[Error - 4:48:00 PM] Request textDocument/diagnostic failed....

How to include non js, ts files from the external dependency during the nuxt build?

hi, I have an external dependency in my Nuxt project, which contains some cadence cdc files, but when i run nuxt build, the cdc files are not included in the node_modules in the .ouput, is there a way to include it? thanks

Shared types/utils

There appears to be work on a common shared folder that can be imported/auto-imported via both Vue and the server at https://github.com/nuxt/nuxt/issues/28675 Is there a way to achieve this now in Nuxt3 by just updating my config? I understand the full implementation of this feature will have guards in place, but I just need a simple single location that is auto imported on both sides....

@nuxt/icon custom collection with ssr: false

I'm trying to create a custom collection of icons, but I'm having trouble because I have SSR set to false. My configuration for icons is simple: `
icon: { customCollections: [...