ok3n
ok3n
NNuxt
Created by ok3n on 11/5/2024 in #❓・help
Cannot start nuxt 3.14.0: Nuxt module should be a function
After updating from 3.13.1 to 3.14.0, we are getting the following error: Cannot start nuxt: Nuxt module should be a function: @custom-vite-alias/module Our nuxt config:
modules: [
'@custom-vite-alias/module',
],
alias: {
'@custom-vite-alias': path.resolve(__dirname, './../../shared/utils/'),
}
modules: [
'@custom-vite-alias/module',
],
alias: {
'@custom-vite-alias': path.resolve(__dirname, './../../shared/utils/'),
}
and our custom module in ./../../.shared/utils/module/index.js (taken from the official documentation)
import { defineNuxtModule } from '@nuxt/kit'

export default defineNuxtModule((options, nuxt) => {
nuxt.hook('pages:extend', pages => {
console.log(`Discovered ${pages.length} pages`)
})
})
import { defineNuxtModule } from '@nuxt/kit'

export default defineNuxtModule((options, nuxt) => {
nuxt.hook('pages:extend', pages => {
console.log(`Discovered ${pages.length} pages`)
})
})
Any ideas on how to fix it?
6 replies
NNuxt
Created by ok3n on 8/27/2024 in #❓・help
Nuxt 3.13 typescript vue imports issue
We're experiencing a type mismatch issue for the ref function between our main app and a library after upgrading to Nuxt 3.13. This wasn't an issue in Nuxt 3.12. Main App: - Vue 3 (v3.4.38) - Nuxt 3 (v3.13) Library: - Vue 3 (same version as main app) In the main app: - ref is auto-imported - Type is resolved from /node_modules/@vue/runtime-core/.../dist In the library: - ref is explicitly imported Type is resolved from /node_module/@vue/reactivity/dist Result: - Getting a type error: type Ref doesn't match type Ref Previous behavior (Nuxt 3.12): - ref was correctly resolved to /node_module/@vue/reactivity/dist in both cases
4 replies
NNuxt
Created by ok3n on 7/23/2024 in #❓・help
Lazy loading components outside of /components
Hello! I know we can prepend "Lazy" to a component name to lazy load it. But would it work if the component is explicitely imported from somewhere else than /components? Like this: from import Banner from '@/components/Banner/Banner.vue' to import LazyBanner from '@/components/Banner/Banner.vue' or even from a vue component library ? from import Button from '@library/Button.vue' to import LazyButton from '@library/Button.vue' would this work?
2 replies