NuxtN
Nuxt3y ago
14 replies
Nossie

External Components

So im trying to build a platform(nuxt 3) with a base template that can use external components ( build in and with nuxt 3) , from what i read it the documentation you can set a different folder to import component like :

 components: [
        { path: '~/node_modules/special', prefix: 'Special' },
        '~/components'
    ],


this works like it should, the only thing is that if you use refs inside the script part in those components that are loaded from somewhere else it gived a 500 error saying ref is not defined.

is there a way to get this working without importing ref from vue ? in components that are auto imported because of the path in nuxt.config ?

also this is only happening when the folder is in node_modules
Was this page helpful?