Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Ignore i18n cookie if directly opened an URL with a different locale

Hi! I have an Nuxt 2 project with i18n enabled and 4 locales configured. I am running into an SEO issue, where deeplink for page specific to given locale e.g. /de-DE/mypage will throw 404 when user has previously browsed using another locale. It seems, Nuxt always reads the cookie and redirects to previous locale. I tried many setup changes in nuxt.config they do not seem to have any effect even skipSettingLocaleOnNavigate : true as well. So, question is - is it possible to force locale change when user opens a link from another source that has different locale then the one browsed/saved in i18n_redirected cookie?...

Whats up with Nuxt + Shared Web Workers?

Shared Web Workers are 100% across all major browsers and Safari on IOS since 2022. But I can't find any documentation or examples on how to use SharedWorker() in Nuxt. nuxt-worker looks interesting, but it doesn't do shared workers and hasn't had a major update in a year....

How do I create routes in Nuxt UI?

I am trying to create a navigation across multiple pages/views in the Nuxt UI. How do I set up the routes globally?

Kinda lost on how to handle errors on thrown on server properly on the client

i'm doing some validation on payload of the a login api i've got using, and i check the instance of the error being thrown to get something to work with on the frontend, but its the 500 error that's being thrown instead, i'm loosing my mind
No description

changing the topic

hello everyone. please tell me, what is the best way to implement a theme change without using the colorMode module?

How to support external assets properly ?

Hello, I do have my application running properly using the ~/assets url for my embedded content and the rest in the public folder. Which is fine for my "static assets". However for my product images and such, they are uploaded in the admin by various clients. Those images are stored on S3. Previously in angular/aurelia/react and such frameworks i was not doing SSR and used a reverse-proxy nginx config to redirect anything starting with "/cdn" to "http://myapp.assets.s3-eu-west-1.amazonaws.com/"...

Huge head payload in server components

Hi! On my website I use a lot of server components for different generated markdown sections (around 20 server component requests). Problem is that each one of them looks like this (request.txt), so it has my little payload and GIANT head sections with data from nuxt seo and @nuxt/ui. Problem? WIth head: 7778 bytes, without 394, almost 20x difference. Why? Why even head is sent here, is there any option to disable it? Additionally, each request has a lot of HTTP meta, around 648 bytes. Is there any option to combine small server components? Or a better way to render a lot of markdown, for example in UAccordion FAQ page?...

net::ERR_CONTENT_LENGTH_MISMATCH when i try to open nuxt dev server on android virtual device.

i'm facing this issue for several days. vite dev server cannot accessible to android studio devices for some reason. i tried it several fresh nuxt projects and vue project, it's only happens in in nuxt 3. i dont know what is the nuance bu i hope you guys can help
No description

Nuxt UI in Vite: Icons loading issue

Hi, I have a problem in nuxt/ui integration in vite, unfortunately my client during testing let me know “Looking into this, we found that the application is trying to load the icons from different internet servers - and access to those servers is blocked when working from the office.”. So I leave with the question, how am I able to deliver the icons? I tried adding the @iconify package to package.json, but it didn't help (as far as I can see it only works for plugging into nuxt)

Nuxt 3: How to close window open javascript

How can I close a popup window when using window.open()? Step 1: Open the popup using window.open(url, "", "width=200,height=100") Step 2: After completing an action successfully in the popup, receive a Firebase notification to close the window and call an API to get the list....

Reading file from folder, but path is different in dev/prod

We have a json file that is generated on build containing our route info. In a request we read the generated file, fetch some data from the backend and return combined json. But we noticed that after deploying the app, path to the generated file is different. Is there a way to use some nuxt/nitro helper so that file location is always resolved correctly?

I want add text and icon in UTable when datas is empty

In the V2 version, I see EMpty-State but the V3 version does not see?

Is there a way to get an element from the dom as writable with typescript support

I want to retrieve a DOM element in Nuxt but the only way I've found online is using ref(null) which does not work TypeScript. Any advice as to how I can retrieve an element like such in Nuxt?

Issues with Directus Cms and Nuxt

Also, I am a bit of a beginner at directus and I am using the How to use directus cms with Nuxt, and when I run my project I am getting these erorrs ARN [Vue warn]: Failed to resolve component: UApp If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <App> at <NuxtRoot> ...

How to use click handlers instead of 'to' in UNavigationMenu items

Also posted on GitHub Discussion How to use click handlers instead of 'to' in UNavigationMenu items Description...

Can I use nuxt ui without vue router

I'm building an electron app so there's not much use for a router. Trying to run without vue-router throws this error at runtime Uncaught SyntaxError: The requested module '/@id/__vite-optional-peer-dep:vue-router:@nuxt/ui' does not provide an export named 'useRoute' I can just install vue-router and not define anything but it'd be great if nuxt ui didn't depend on vue-router...

Nitro Websocket Cookies

Is there a better way to get the cookie from the open method than peer.request.headers.get()? This seems janky when I can normally just getCookie(event, ...), and parsing cookie strings is an annoyance

Questions About Database Migrations

Hi there everyone! I am building a Nuxt app that uses NuxtHub to deploy, and also uses it's database. I have read the docs on database migrations, but still have a few questions. For example, if I have a migration that creates a table, and another that modifies a column in a table, will the second one fail because the table does not exist, or will they run in order? If someone could point me to a guide or doc about migrations in NuxtHub that would be great!

Customize Routing Rule for Main domain and Subdomain(wildcard)

I have created a file app/router.options.ts for the subdomain ``` import type { RouterConfig } from "@nuxt/schema"; import { useRuntimeConfig } from "#app";...

Import file as raw string on a config file (UnoCSS config in this case)

I'm trying to import a css file as a string on a configuration file, in this case is for a feature of UnoCSS named "preflights" which lets you set up css for themes from strings, I'm using import globalCSS from './app/styles/theme-base.css?raw' within the config but I'm getting Cannot restart nuxt: Unknown file extension ".css" for <full file path> any idea on how to make the import work? I'm inlining the css instead of using the file as a workaround. Nuxt 4 compat. edit: fixed it by using normal fs from Node, looks like the module config doesnt go through vite...