NuxtN
Nuxt14mo ago
ok3n

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/'),
}

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`)
  })
})


Any ideas on how to fix it?
Was this page helpful?