Viridian
Explore posts from serversLayout transitions not working between pages
I have a number of pages (index.vue, login.vue and register.vue), as well as a layout
auth.vue
. I have a transition between login.vue
and register.vue
which works:
and
I'm trying to implement a similar transition between index.vue
and either register.vue
or login.vue
. However, it doesn't seem to be working:
Why is this? I thought I needed a layout transition since index.vue
uses the default layout, and login.vue
and register.vue
use the auth
layout.36 replies
Tailwind classes not applying while using Nuxt UI v3
I'm running into some strange behaviors with Nuxt, using NuxtUI v3.
I followed the installation guide on the Nuxt site (including wrapping <NuxtPage> in <UApp>). Using components like <UCard> works and displays, but trying to apply classes like
class="font-bold"
doesn't do anything. I also tried adding a font in my theme, but trying to apply those doesn't result in anything either.
I'm not sure what I'm doing wrong, haha13 replies
Nuxt errors after refreshing package-lock.json (A composable that requires access...)
I'm getting the following errors after refreshing my package-lock.json/updating some packages:
Error: [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function. This is probably not a Nuxt bug. Find out more at https://nuxt.com/docs/guide/concepts/auto-imports#vue-and-nuxt-composables.
⁃ at useNuxtApp (C:/Users/.../Documents/GitHub/es-nuxt/nodemodules/.pnpm/[email protected]@[email protected]_@[email protected][email protected][email protected][email protected]tgdyf4tahfh2p7d7ptjabx7uva/node_modules/nuxt/dist/app/nuxt.js:248:13)
⁃ at useRuntimeConfig (C:/Users/.../Documents/GitHub/es-nuxt/nodemodules/.pnpm/[email protected]@[email protected]_@[email protected][email protected][email protected][email protected]tgdyf4tahfh2p7d7ptjabx7uva/node_modules/nuxt/dist/app/nuxt.js:258:10)
⁃ at useLocalMarket (C:/Users/.../Documents/GitHub/es-nuxt/utils/localMarket.ts:3:60)
1 ┃ export default function useLocalMarket() {
2 ┃ const config = useRuntimeConfig().public
❯ 3 ┃
4 ┃ const localMarket = config.localMarket
5 ┃
6 ┃ const isLocalMarket = (country: string) => {
7 ┃ return localMarket.toLowerCase() === country.toLowerCase()
8 ┃ }
9 ┃
10 ┃ const titlePostfix = () => {
11 ┃ let postfixMapping = new Map<string, string>()
useLocalMarket is a composable:
export default function useLocalMarket() {
const config = useRuntimeConfig().public
const localMarket = config.localMarket
const isLocalMarket = (country: string) => {
return localMarket.toLowerCase() === country.toLowerCase()
}
const titlePostfix = () => {
let postfixMapping = new Map<string, string>()
postfixMapping.set('be', 'België')
postfixMapping.set('nl', 'Nederland')
postfixMapping.set('flags', '')
return postfixMapping.get(localMarket.toLowerCase())
}
return {
localMarket,
isLocalMarket,
titlePostfix
}
}
5 replies
Cannot find 'nuxt.mjs' during build in Dockerfile
Hey all,
I'm trying to build my Nuxt application via Docker, but my Dockerfile is giving me the following error:
This is my Dockerfile:
Building locally seems to work just fine, so I'm not sure what's causing this issue. Any help would be appreciated!
5 replies
<USelect> in #trailing slot in <UInput> does not appear clickable
I'm trying to make this work:
However, the <USelect> inside the UInput's trailing slot doesn't seem to be clickable and doesn't activate a dropdown when clicked. Instead, the click seems to propagate through to the button. I tried
@click.prevent
and @click.stop
, but they didn't seem to work.
What else am I missing?16 replies
Strange error when trying to run dev mode on a fresh install
For some reason, I seem to be getting this error when trying to run dev mode on my fresh Nuxt installation. I only installed
nuxthub
:
Any idea what is going wrong here? It seems strange.22 replies
Label templates for <UInput> elements
Hey all,
I'm trying to add a <UTooltip> to one of my <UInput> elements. However, I'm not sure how to approach this. Is there a way to, for example, override the label using a template to add my own elements, or is this not possible? Is there another approach? Thanks in advance!
19 replies
Retrieve error status code and display error on page
I'm trying to get some error handling logic to work. I have this pipeline:
Which logs the following:
So it's seemingly creating the Nuxt error, but the message or status code doesn't seem to match. This is the fetch function in my page that calls this event handler:
Ideally I want to be able to know when the error was created and display a custom error message to handle it on the front-end.
This might have a pretty simple answer, but I'm not really sure how to approach this
3 replies
Unable to get logs from Event pipe in defineEventHandler
Hey y'all, interesting question.
I'm using Effect in order to build my pipelines for events that are handled by Nuxt's server, like this:
However, for some reason, trying to log errors from the event pipe does not result in anything being logged. I'm encountering a parse error during decoding and want to log what the result of parseBody is, but it's not printing anything. I'm not entirely sure why this is, because logging anywhere else but on the incoming itself seems to work fine.
2 replies
Use incoming event type in defineEventHandler
I want to run some custom logic using a function that takes the event from an event handler in a
.post.ts
file:
However, I want to use the type of the event in my function parameter so it doesn't error. What type do I use? When I hover over it, I get (parameter) event: H3Event<EventHandlerRequest>
but I can't seem to import that into my own code, and I'm also not sure if that's the type I want to be using. Is there an easier type that would work for this provided by Nuxt?
I basically just want to be able to get the event typed properly, passed into that function and then parsed with readValidatedBody
, etc.9 replies