Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Security middleware does not work on prod but does work on dev

Hey! I just implemented the security module from Nuxt3 (https://nuxt-security.vercel.app/?utm_source=nuxt.com&utm_medium=aside-module&utm_campaign=nuxt.com). However, I encountered an issue where some features don't seem to work in my production (Netlify) environment. I tested it in my development environment, and there, it works fine. Not sure if it has something to do with ssr or Netlify. I am facing the following issues (config in a seperate comment):...
No description

It is Possible to exclude folder in /server/local/** to not build in npx nuxi build ?

I use /server/local to use to test my dummy data from REST API and use useFetch to /public to switching real other Host API. but, when build the live project the folder /server/local is included and i don't needed. How to not included it so the build output has smaller size ?

Extracting `useFetch` return type

Is there a better way of extracting the type my server route is returning from a route in vue side of the app? When I do
const { data } = useFetch('/api/public/metadata')
// data is globalThis.Ref<{ someComplicated: type; withMany: properties }> | undefined
const { data } = useFetch('/api/public/metadata')
// data is globalThis.Ref<{ someComplicated: type; withMany: properties }> | undefined
...

Module dependencies as dev only

Can my module dependencies that are only used in the main defineNuxtModule file be dev only? My module just generates a basically static (no imports) template in the buildDir and defines an auto import for that file

Getting Cookie From Middleware

export default defineNuxtRouteMiddleware(async (to, from) => { const isAuthenticated = useCookie('token') if((to.name === "login" || to.name === "register") && isAuthenticated.value) { console.log('user is logged in')...

How to forward logs to a Slack channel?

How can I send specific logs or all logs from a Nuxt 3 application to a Slack channel? Is there an integration for this? I do not want to use a paid tool like Sentry. Not all logs should be forwarded, only: - Errors (console.error)...

path to dependency

I'm working on a nuxt plugin to integrate a vue+tailwind components library. for tailwindcss to work the files from that library need to be referenced in the generated config file. I've had some success using: ```ts...

nuxt/content queryCollection not returning results when using .order()

Hey all - I'm using Nuxt Content for the first time and loving it but I've hit an issue with trying to order results from the queryCollection(). Here's my .md file frontmatter: ``` --- title: test post 2 date: 2025-01-01...

@tus/server production build error

[nitro] [uncaughtException] Class extends value [object Module] is not a constructor or null

Static builds with nuxt content result in empty pages

My [slug].vue : ```js <script setup> const path = useRoute().path...

Is it possible to change nuxt layers on the fly (run time)?

We have themes which all of them contains nuxt project and a folder for main. whats the best solution if we needed to switch themes like just by a dropdown? an old solution that we got was just having pages inside only main then use the components like PageMain inside the index.vue, sooo whats the best way to have something like that

Two component files resolving to the same name `UiLabel`

Hello, I'm creating a web application and when I try to make a component in the folder app/components/ui/label/index.ts and app/components/ui/label/Label.vue like shadcn-vue does I have this error : ``` WARN Two component files resolving to the same name UiLabel: ...

defineShortcut(): meta key doesn't work on linux?

Hey I'm running an arch linux system with kde plasma and firefox. Shortcuts with meta_ don't work for me at all. Now I understand linux is always iffy but this does seem like a bug to me right now. Want to ask if others have the same issue on other distros before i open an issue my code: ```ts...

Vscode and autoimport

My vscode adds import statements when I select from the suggestions. for example when I start typing <TuiC it suggests the component but when select it adds this: import TuiContainer from '~/components/tui/TuiContainer.vue'...

"export" PageMeta overrides from layer

I have an auth layer that has a middleware that checks routse for route.meta.permissions I added that to a .d.ts file so I get full type safety: ```ts declare module "#app" {...

Setting Up An Article Based Website Using Nuxt Content

Hi all, Has anyone managed to set up a Nuxt3 content site? I believe I have done all the steps correctly:...

Custom pagination in Swiper in Nuxtjs

hey everyone, did anyone worked before with swiper in nuxt ? im trying to change the pagination style and I couldnt know how to use swiper in nuxt js as it isnt the same as vanilla swiper

Get app version

Is there a good/official way to get the version of the Nuxt app? I suppose this would be pulled from package.json and git. So if I build the app with version v1.0.0 in package.json but the git tag isn't v1.0.0, I'd want the web page to show version "v1.0.0-DEV" or something to indicate it's not an actual release

Prevent dark mode in mobile when it's activated

How we can disable or prevent the dark mode in mobile when it's activated? So when I activated the dark mode from my phone, all initial background of elements become dark.

[Content 3] Multiple sources

According to https://content.nuxt.com/docs/collections/sources Can I create collection with multiple sources? For example: ```javascript posts: { source: [{...