Thr0nSK
Thr0nSK
NNuxt
Created by Thr0nSK on 6/24/2024 in #❓・help
`import.meta` meta-property is only allowed when the --module option is ...
No description
4 replies
NNuxt
Created by Thr0nSK on 6/19/2024 in #❓・help
Use an async function for `getCachedData`
Hi! I'd like to use an async function for the getCachedData option in useAsyncData (specifically, in useFetch) Is that possible? I couldn't get it to work..
4 replies
NNuxt
Created by Thr0nSK on 5/23/2024 in #❓・help
Memory management in Nuxt
Hi there! I was wondering whether you could share some resources about memory management in Nuxt, specifically some anti-patterns and/or good practices. I've been having problems with huge memory leaks in my apps, and I don't know where to start looking for potential problems. The documentation is quite lacking in this regard, in my opinion. The only thing mentioning memory leaks that I was able to find was not to use ref outside the script setup context. I'd be happy to write the docs for this topic once I understand it in more detail.
6 replies
NNuxt
Created by Thr0nSK on 4/10/2024 in #❓・help
Rendering a component in server routes
Hi! I'd like to return the html of a rendered component in a server route (e.g. /images/logo -> should return the html of LogoComponent.vue) Would something like this be possible?
8 replies
NNuxt
Created by Thr0nSK on 3/28/2024 in #❓・help
Dynamic route Vue Router warn
No description
5 replies
NNuxt
Created by Thr0nSK on 2/9/2023 in #❓・help
Dynamically added route at runtime
Hi, I'm trying to dynamically add a route at runtime, however, the solution below seems to add the route only after it's already resolved (?)
export default defineNuxtPlugin(nuxtApp => {

const router = useRouter()

addRouteMiddleware('routing', async (to) => {
if (to.path == '/my-awesome-product') {
router.addRoute({
component: () => import('/pages/product.vue'),
name: 'product',
path: to.path
})
}

}, { global: true })

})
export default defineNuxtPlugin(nuxtApp => {

const router = useRouter()

addRouteMiddleware('routing', async (to) => {
if (to.path == '/my-awesome-product') {
router.addRoute({
component: () => import('/pages/product.vue'),
name: 'product',
path: to.path
})
}

}, { global: true })

})
When I navigate directly to /my-awesome-product, I get a 404 but if I continue to use the site without reloading (so that the route stays in the local vue router), the next navigation to /my-awesome-product works fine. Any idea what I'm doing wrong? Thanks!
3 replies
NNuxt
Created by Thr0nSK on 1/17/2023 in #❓・help
Nuxt extends doesn't work
Hi, I'm trying to use extends to auto import components from another nuxt project in a different directory, however, no matter what I do, I cannot get it to work. When the project I'm extending has any module, I get an error that it could not find the module. When I try to extend a simple nuxt project with only 1 component, I don't get an error but I cannot use the component inside the project that is extending it. This is what the nuxt.config.ts file looks in the project that is extending the base one:
export default defineNuxtConfig({
extends: [
"../test-extend",
],
})
export default defineNuxtConfig({
extends: [
"../test-extend",
],
})
Am I doing something wrong? I've even tried extending a github repo, for example:
export default defineNuxtConfig({
extends: [
"github:antfu/vitesse-nuxt3",
],
})
export default defineNuxtConfig({
extends: [
"github:antfu/vitesse-nuxt3",
],
})
And I got an error that it could not find the VueUse module...
1 replies