Questions tagged [nuxtjs3]

Tag for questions related Nuxt3. More info can be found here: https://nuxt.com/

Tag for questions related Nuxt3. More info can be found here: https://nuxt.com/

1553 questions
85
votes
9 answers

How to get route url params in a page in Nuxt2 and 3?

I am using Nuxt.js, and have a dymanic page which is defined under pages/post/_slug.vue So, when I visit the page url, say, http://localhost:3000/post/hello-world, how can I read this slug parameter value inside my page. Currently I am geting it…
asanas
  • 3,782
  • 11
  • 43
  • 72
28
votes
5 answers

Nuxt 3 JWT authentication using $fetch and Pinia

I'm trying to do a JWT authentication to a distinct API. As @nuxtjs/auth-next doesn't seem to be up to date and as I read it was possible to use the new global method fetch in Nuxt 3 instead of @nuxtjs/axios (not up to date also), I thought it won't…
Claire
  • 773
  • 1
  • 8
  • 19
18
votes
2 answers

How to subscribe to a specific action in Pinia

Does anyone know if it's possible to subscribe to a specific action in Pinia? I know there's a way to subscribe to all actions like this: const subscribe = someStore.$onAction(callback, false) But that means I have to compare action name to the one…
Marek Miś
  • 259
  • 2
  • 8
17
votes
6 answers

How to set global API baseUrl used in useFetch in Nuxt 3

How do I set the baseUrl that is used in the useFetch composable globally (maybe nuxt.config.ts)? How can I avoid defining it in every useFetch?
Dickson Afful
  • 708
  • 1
  • 6
  • 20
16
votes
1 answer

NuxtLink is updating route in nuxt 3 app, but not rendering contents

I am trying to use route using NuxtLink in a Nuxt 3 app, and it's changing the route, but it's not showing any contents. But, if I refresh or reload the updated route which was blank ago, then it's showing it's content…
Sabbir Sobhani
  • 389
  • 8
  • 15
15
votes
2 answers

Nuxt not automatically importing components from nested directory

In my nuxt app, components in nested directories are not automatically importing as expected. For some of my components i have something like the following: vue 2.6.12, nuxt 2.15.0 components\ Directory…
jtlindsey
  • 4,346
  • 4
  • 45
  • 73
14
votes
4 answers

"The Fetch API is an experimental feature. This feature could change at any time" while installing a Nuxt3 app

I try to creat new nuxt app using fallowing command npx nuxi init my-app successfully creating new app with Nuxt 3.0 stable inside but i get this annoying response Nuxi 3.0.0-rc.10 …
mart cube
  • 633
  • 1
  • 15
  • 30
14
votes
4 answers

Cannot find module 'pinia/dist/pinia.mjs' when using run dev

I setup Pinia on top of fresh Nuxt3 app and start dev server, with exactly these commands in order: npx nuxi init nuxt-app cd nuxt-app npm install npm install @pinia/nuxt npm run dev Dev server runs without any problem. Then, i put this line of…
Clarity
  • 186
  • 1
  • 7
13
votes
13 answers

Nuxt 3 SSR: useFetch() returning null on page refresh

(After having edited my original question many times over, I have decided to completely rework it as to make it more clear and succinct. This is in accordance with StackOverflow recommendations.) The setup: Create a new Nuxt 3 project: pnpm dlx nuxi…
wire417
  • 150
  • 1
  • 12
13
votes
1 answer

Nuxt 3 - Pinia Vs useState()

Store (Pinia) Vs UseState If I am not mistaken, useState can replace any store like Pinia? Given that useState makes ref sharable across all components I have a hard time knowing if I should use a store or a useState ref. For instance, let's say I…
AhmadReza
  • 421
  • 6
  • 20
12
votes
1 answer

How to add a script block to head in Nuxt 3?

I simply want to add a script block in the head tag. Example I spent hours to figure out a solution for something as simple as this. There are tons of answers about adding inline scripts, but none for…
Moon
  • 33,439
  • 20
  • 81
  • 132
12
votes
2 answers

exports is not defined in ES module scope

I created nest js project as following. nest new project-name and imported following from nuxt3 which is of type module of node js with mjs file extension (type definition of import doesn't require to write mjs). import { ViteBuildContext,…
Anonymous Creator
  • 2,968
  • 7
  • 31
  • 77
12
votes
1 answer

How to use SSR with Vue 3 - Vue packages version mismatch

I have a working Vue 2 app with server side rendering. Now I'm trying to upgrade to Vue 3 but stuck on the SSR part cuz the vue-server-renderer package throws the following error: Vue packages version mismatch: - vue@3.0.0 -…
Nio
  • 497
  • 3
  • 6
  • 16
11
votes
3 answers

Client-only Nuxt 3 Vue plugin

I am new to Nuxt and Vue, so go easy on me. I am trying to create a video player component in my Nuxt 3 app using vue3-video-player, which doesn't seem to support SSR based on the following error I get when I import it in my video…
gsundberg
  • 437
  • 1
  • 4
  • 14
11
votes
3 answers

How to configure eslint and prettier with nuxt 3?

I have installed these dependencies Package.json: { "devDependencies": { "@intlify/nuxt3": "^0.1.6", "@nuxtjs/eslint-config": "^7.0.0", "@nuxtjs/eslint-module": "^3.0.2", "eslint": "^8.1.0", …
NonOrganicCreature
  • 159
  • 1
  • 1
  • 9
1
2 3
99 100