I'm trying to setup bootstrap-vue/nuxt but i got this error "Cannot restart nuxt: Cannot read properties of undefined (reading 'hook')"
thismujahid opened this issue · comments
First I ran npm i bootstrap-vue
Then imported bootstrap-vue/nuxt
into nuxt.config.ts
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
'bootstrap-vue/nuxt',
],
)}
i got the folowing error into the terminal
ERROR Cannot restart nuxt: Cannot read properties of undefined (reading 'hook') 1:31:39 PM
at nuxtBootstrapVue (node_modules\bootstrap-vue\nuxt\index.js:34:13)
at installModule (/F:/clinic-pets/node_modules/@nuxt/kit/dist/index.mjs:2426:101)
at async initNuxt (/F:/clinic-pets/node_modules/nuxt/dist/index.mjs:3533:7)
at async NuxtDevServer._load (/F:/clinic-pets/node_modules/nuxi/dist/chunks/dev.mjs:210:5)
at async NuxtDevServer.load (/F:/clinic-pets/node_modules/nuxi/dist/chunks/dev.mjs:161:7)
at async _applyPromised (/F:/clinic-pets/node_modules/nuxi/dist/chunks/dev.mjs:94:10)
I did these steps based on what was mentioned in the official documentations and I expected that it would work normally
But it seems that nothing in this world is that easy 😂😂
Libraries and Versions:
- "bootstrap-vue": "^2.23.1"
- "nuxt": "^3.7.1"
My package.json file content:
{
"name": "nuxt-app",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxt/devtools": "latest",
"@nuxtjs/color-mode": "^3.3.0",
"@nuxtjs/i18n": "^8.0.0-rc.4",
"nuxt": "^3.7.1"
},
"dependencies": {
"@formkit/nuxt": "^1.0.0",
"@nuxtjs/robots": "^3.0.0",
"bootstrap-vue": "^2.23.1"
}
}
BootstrapVue doesn't support Vue 3. Which is what Nuxt 3 uses.
But they have added a way in the docs to use BootstrapVue with nuxt which is here and they also write:
Nuxt.js version 2.15.8 (or greater) is recommended.
Which means I can use it with Nuxt 3 due (or greater), alright?
Which means I can use it with Nuxt 3 due (or greater), alright
That was written well before Nuxt 3 existed. So no, its limited to Nuxt 2.