nuxt.js Questions
2
When getting started with nuxt 3, it creates TypeScript project by default.
Is there a way to move to JavaScript?
I have tried:
Rename nuxt.config.ts to nuxt.config.js
delete tsconfig.json
add jsc...
Alongside asked 31/10, 2021 at 7:49
2
This is a reliable way to get the host url in both SSR and CSR:
let host = context.req ? context.req.headers.host : window.location.origin
But where to put this so all compoments can access the ...
4
Solved
I can't use window.location here because it's SSR app.
useRouter, useRoute, and useNuxtApp don't have domain name too.
nuxtApp.ssrContext is undefined.
export default defineNuxtRouteMiddleware((to:...
3
Solved
I'm trying to identify if my Nuxt app (2.14.0) is using Vue 2 or Vue 3, and I cannot tell. I have dived through node_modules and looked at my lock file but can't say for certain. I think it's using...
Inerney asked 29/9, 2020 at 16:57
4
Solved
In nuxt config I have env object
env: {
hey: process.env.hey || 'hey'
},
as soon as I want to display it in component template:
{{ process.env.hey }}
I got an error
Cannot read property ...
Sisal asked 19/12, 2019 at 16:41
4
Solved
I'm using nuxt / content in my app and it's working fine. In another part of the app, I'd like to fetch some markdown from a database and display it.
let mytext = "Some *markdown* fetched from...
Strasbourg asked 8/4, 2021 at 22:32
2
Solved
I am running Nuxt and I have the below function. I want to check if authenticated then redirect to the login page if not. I am getting the error window is undefined This make since because it is my...
Anjanette asked 30/7, 2019 at 18:25
3
Solved
In NuxtJs app i got data() on server side by AsyncData() method.
For example, I need to delete one entry and refresh the page without restarting the browser.
In pure Vue, I would write an ajax m...
1
Solved
There are some tutorials out there (e.g. https://medium.com/geekculture/chart-js-in-nuxt-js-how-to-implement-c255a2657b02) that show how to integrate Chart.js with an earlier version of Nuxt 3 or e...
Happen asked 12/5, 2023 at 12:35
3
I tried the old solution but it not works any more, then I tried to read the nuxt 3 documentation, and it is not actually update.
So how to change How to change Nuxt 3 Port without change dev scrip...
Osteopath asked 8/12, 2022 at 11:2
3
I'm trying to create a middleware to redirect all my routes to https, I think I need a middleware so I've created a redirect.js file in the middleware folder of Nuxt and then I've added this to nux...
Oculus asked 17/6, 2019 at 10:46
1
Solved
I'm trying to test if my nuxt page renders the content, it receives from a composable. In the real scenario, the composable would fetch information from an external API. To keep my tests independet...
2
Solved
I have a problem running the npm run test. The error is
[Vue warn]: Unknown custom element: <nuxt-link> - did you register the component correctly? For recursive components, make sure to pro...
9
Solved
Problem
I'm using nuxt 1.4 with routing using Jest to do unit testing. My application doesn't throw errors and seems to work perfectly. However when running my unit test npm run unit (which runs je...
Plating asked 5/4, 2018 at 6:33
1
I am working on a project and I am using nuxt for it. API calls are being made to node.js server over https, and since everything is in my local development, I am using self signed certificates.
...
3
Solved
I have a NUXT project which i'm trying to add 301 redirect to. I've tried a few different approaches, but nothing works. If I go to the old URL I get a 404 page.
Whats the best way to add redirects...
Szabadka asked 16/7, 2021 at 21:48
6
I'm trying to set up debugging with vscode on a nuxt project using:
https://medium.com/@justin.ramel/nuxt-js-debugging-in-visual-studio-code-822ff9d51c77
I've gotten as far as :
$ npm run dev-debu...
Slowmoving asked 3/1, 2019 at 18:59
9
I'm trying to integrate Bootstrap 5 in a new Nuxt 3 project but I'm facing a problem that I cannot solve : I want to optimise it by importing only the necessary modules (both scss and javascript) a...
Moustache asked 24/11, 2021 at 16:32
1
Solved
[Vue warn]: onServerPrefetch is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using asyn...
4
I'm a little confused because on the official nuxt site it says the current nuxt version is 2.5.X but when I create a nuxt app with npx create-nuxt-app and check the package.json under dependencies...
Tauto asked 15/4, 2019 at 14:57
1
I'm trying to populate page title and meta tags with dynamic data coming from api for seo purpose. but unable to get it in view-page-source
I've tried useHead, useSeoMeta and useServerSeoMeta with ...
2
Solved
I define a className to customize a sweetAlert2 but apparently the styling wont apply to the sweet alert. I called the class name everything but nothing seems to work. could the problem be with mai...
Mitten asked 13/4, 2021 at 20:7
2
Solved
I have a use case where I need to pass a specific error message to a custom component. If and only if a certain prop is set to true. But I doubt this.required is available within the props because ...
2
Solved
Hi everybody i'm trying to watch on route changes in my nuxt js app.
Here my middleware:
export default function ({ route }) {
return route; but i don't know what to write here
}
index.vue F...
Duala asked 18/10, 2018 at 12:48
4
Solved
I created a blog in Nuxt.js which uses Markdown for my articles. When writing my first article, I realized I can't include images in my markdown article from my assets folder. It only works if it's...
© 2022 - 2024 — McMap. All rights reserved.