Questions tagged [nuxt.js]
Nuxt.js is a framework for creating Vue.js applications, you can choose between Universal, Static Generated or Single Page application (inspired by Next.js)
nuxt.js
13,084
questions
614
votes
51
answers
824k
views
Why does Prettier not format code in VS Code?
In my Nuxt application where ESlint and Prettier are installed and enabled, I switched to Visual Studio Code.
When I open a .vue file and press CMD+ Shift + P and choose Format Document, my file does ...
155
votes
6
answers
356k
views
Why is 'type: module' in package.json file?
I upgraded the node and built the existing file.
But it didn't build, and there was an error.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: │
│ ~~/nuxt....
100
votes
10
answers
39k
views
Nuxtjs vuetify throwing lots of `Using / for division is deprecated and will be removed in Dart Sass 2.0.0.`
Nuxtjs using vuetify throwing lots of error Using / for division is deprecated and will be removed in Dart Sass 2.0.0. during yarn dev
Nuxtjs: v2.15.6
@nuxtjs/vuetify": "1.11.3",
"...
94
votes
22
answers
105k
views
Vuejs Error: The client-side rendered virtual DOM tree is not matching server-rendered
I am using Nuxt.js / Vuejs for my app, and I keep facing this error in different places:
The client-side rendered virtual DOM tree is not matching server-rendered content.
This is likely caused ...
89
votes
9
answers
221k
views
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 ...
88
votes
12
answers
196k
views
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main resolved in /app/node_modules/@babel/helper-compilation-targets/package.json
I'm having trouble building my nuxt images in a travis CI pipeline. My local environment is ubuntu 18.04 - docker version 19.03.11 docker-compose version 1.24.1 I'm able to build and run my images ...
78
votes
5
answers
38k
views
Difference between Asyncdata vs Fetch
What is the exact difference between fetch and async data. The official documentation says the following:
asyncData
You may want to fetch data and render it on the server-side. Nuxt.js
adds an ...
70
votes
8
answers
143k
views
How to get current route name in Nuxt 2 and 3?
I'm using Nuxt.js for building a static website.
How to access in component's script code currently displayed route name (I would like to avoid reading direct url from browser location)?
Can I ...
67
votes
9
answers
117k
views
“window is not defined” in Nuxt.js
I get an error porting from Vue.js to Nuxt.js.
I am trying to use vue-session in node_modules. It compiles successfully, but in the browser I see the error:
ReferenceError window is not defined
...
65
votes
6
answers
111k
views
potentially fixable with the `--fix` option
I am creating a app with nuxt.js but everytime I launch the app, gives me the error of eslint and saying "potentially fixable with the --fix option."
I did the command npm run lint -- --fix and it ...
62
votes
8
answers
71k
views
How to solve "semi-colon expected" warnings (css-semicolonexpected)
I'm trying to use Tailwindcss @apply directive in a <style> tag of a Nuxt.js Vue file. Everything works fine, but I keep getting some annoying red squiggly lines. Please, guys, I need help... ...
61
votes
4
answers
42k
views
How to set lang attribute on html element with Nuxt?
Using the file nuxt.config.js file, head contents can be customized to add some meta, or other things:
module.exports = {
/*
** Headers of the page
*/
head: {
title: 'awesome title',
...
57
votes
1
answer
34k
views
nuxt build --spa vs nuxt generate
What is the difference between
nuxt build
vs
nuxt generate
vs
nuxt build --spa
I am trying to compile three different variations:
1. regular nuxt with ssr
2. prerendered spa
3. spa without ...
54
votes
9
answers
41k
views
capacitor.settings.gradle' as it does not exist
I am new to Ionic while build the app in android. Its opening a project in Android Studio but while gradle sync its showing the following error
Could not read script 'F:\IonicProjects\mis-tracking-...
48
votes
3
answers
26k
views
NUXT- assets and static folder - when to use which?
Being new to NUXT, I am a bit confused about the difference between the assets and static folders.
in the documentation regarding this folders it says:
every file below 1 KB will be inlined as ...