Nuxt

N

Nuxt

Nuxt Community Chat Server

Join

Error with bode 23.1

While running project with node version 23.0 and higher I've got the error ExperimentalWarning: CommonJS module /usr/src/app/node_modules/tailwindcss/lib/lib/load-config.js is loading ES Module /usr/src/app/tailwind.config.js using require(). Support for loading ES Module in require() is an experimental feature and might change at any time...

Any way to fix sourcemaps being completely wrong?

For some reason sourcemaps in our Nuxt 3 application has suddenly stopped working correctly. Breakpoints set in VS Code are no longer applied where you think they are, they are applied and triggered to other lines of code than the ones you chose. Does anyone have any clue what could cause this? I'm clueless....

How to write test for API with authenticate required.

Hello there. is there way to test out api endpoint while building fullstack app. let say i have authenticate route powered by https://github.com/atinux/nuxt-auth-utils . i want to test if the result of the endpoint is fullfill the test required but i did not really know how to test that endpoint . i was reading the laravel test and find https://laravel.com/docs/11.x/http-tests#session-and-authentication maybe one of you have any idea about this how to do test api with authenticate like larav...

Amplify deployment

How i can deploy nuxt 3 app with ssr in aws amplify with redirect rules

Nuxt3, Vitest, Vuetify3: unable to resolve Vuetify components

Hi everyone! I am having a hard time with a setup based on Nuxt3 + Vuetify3 + Vitest. Nuxt's testing docs implies that using mountSuspended in unit-tests should allow vitest to resolve autoimports, but I get this error for each vuetify component when running tests: [Vue warn]: Failed to resolve component: v-row If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at <MountSuspendedComponent >...

NuxtUI v2 make primary color black

Hi I am using nuxt ui v2 in my project and I want my app to be light theme with black elements on it, but I am not able to change my primary color to just black (or any other color) I don't know what to do, it looks like if the ui library was just completely ignoring my app config. My debug app config that doesn't work: app.config.ts ```...

middleware

I created a middleware in which I send an api request and validate the JWT token. In the vue app I have a token download from the serwer. App.vue ```<script setup> const { useAccessToken } = useAuth();...

Vitest times out when mocking the Router

Hey, I'm currently trying to mock useRouter().push(), but unfortunately, Vitest (the mountSuspended function) times out. ```ts // Some stuff const mockRouterPush = vi.fn();...

Tailwind works, but doesn't show suggestions (intellisense) in a Nuxt project

Here's the relevant content inside the tailwind config file: ```js export default { content: [ "./components/*/.{js,vue,ts}",...

v-bind not unwrapping reactive properties from composable

I have a helper composable here for orchestrating common aria attributes for form fields. ```typescript export function useFieldControl(args: UseFieldControlArgs): UseFieldControlReturn { const fieldId = args.id || useId();...

Generating thumbnails of site

Hello, I am porting my site from VitePress to Nuxt3 because I need some serverside stuff Nuxt provides. I can't find an appropriate hook to use when the site could be temporarily hosted and opened to take a screenshot to generate a page's thumbnail. I am thinking one of thoes might work? build:done builder:generateApp...

Question about image tag and svgs in production

Hello I am working in Nuxt3 and am fairly new to web dev and very new to Nuxt3 I am trying to learn how to properly use a svg that will work in production. Here is the code that was in my page before moving to a component, it worked in dev and production ```html <span...

How do you make component tests in Nuxt 3?

Guys how do you make visual component tests in Nuxt 3?

Usefetch doesnt work when using middleware

Hi, I have a problem. If I use middleware (even if it is empty), my usefetch does not work during ssr. It does get the data, but it doesn't pass it to the client.

Trouble with multiple pinia actions inside useAsyncData

I want to fetch a bunch of paginated data on pageload, so I use useAsyncData to avoid dupe requests. I get that you're not really meant to use useAsyncData for side-effects but since it's the only mechanism I know of that prevents duplicate fetches, it's what I got. The problem is, when I generate an array of requests to pass into a Promise, the function stalls. It's not that the reqs array is undefined - it's that nothing runs past it inside that function. asyncData simply returns null before ever reaching the Promise. ```...

Sanity Navigation Error: TypeError: can't access property

Hi! I'm using Sanity in my project but I'm facing an issue with navigation. When selecting a project I initially get an error: Uncaught (in promise) TypeError: can't access property 0, $setup.project is null. However clicking the project again successfully navigates to it On the project page I am completely stuck and can't navigate the same error appears in console and I need to do a hard refresh to proceed. I'm using a simple groq query. ...
No description

I don't want timeout to pause on hover for nuxt ui toast

currently i do the below ```ts toast.add({ title: 'Signing out!', color: 'orange',...

Fresh project with nuxt ui pro and pnpm

I am getting ERROR Named export 'compile' not found. The requested module 'tailwindcss' is a CommonJS module, which may not support all module.exports as named exports. on a monorepo with nuxt 3 & nuxt ui 3. Not sure what the cause is of this. Can anyone provide some guidance? ```{...

Global $fetch hooks

Is it possible to globally define hooks for onRequest and onResponseError (apart from having to create a custom useFetch and use that everywhere)?

Working with types and modules

How do I work with types. The docs said that everything is auto imported and types even auto generated, whatever that means, I didn't understand from the docs. Just imported first module and nothing works, beside no errors and nothing appearing the module is not recognize and i can't find in the whole docs a solution how will this can be configured. Says it's working by default
No description