Encountering difficulties with installing bootstrap-vue

While attempting to integrate Bootstrap-Vue into my project that includes Vuex, Vue-Router, TypeScript, and Babel, I encounter an error in the browser.

To replicate

docker run -it --rm -p 8080:8080 node:17.7.2-alpine

yarn global add @vue/cli

vue create my_app

vue add bootstrap-vue

After successfully running yarn serve, I see this error in the browser:

app.js:953 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at eval (config.js?b761:6:1)
    at Module../node_modules/bootstrap-vue/esm/utils/config.js (chunk-vendors.js:3415:1)
    at __webpack_require__ (app.js:950:33)
    at fn (app.js:1205:21)
    at eval (props.js:15:65)
    at Module../node_modules/bootstrap-vue/esm/utils/props.js (chunk-vendors.js:3668:1)
    at __webpack_require__ (app.js:950:33)
    at fn (app.js:1205:21)
    at eval (model.js:8:64)
    at Module../node_modules/bootstrap-vue/esm/utils/model.js (chunk-vendors.js:3591:1)

I also attempted using yarn add bootstrap-vue bootstrap

This is how my main.ts file appears:

import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue';

import 'bootstrap/dist/css/bootstrap.css';
import 'bootstrap-vue/dist/bootstrap-vue.css';

import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';

const myApp = createApp(App).use(store).use(router);

myApp.use(BootstrapVue);
myApp.use(BootstrapVueIcons);

myApp.mount('#app');

The same error occurs in the browser when using this setup

I have tested this with both Vue installed on a Node Docker container and the one installed through yay on Arch Linux.

vue --version @vue/cli 5.0.1

Answer №1

For those working with Vue.js version 3 and eager to implement the newest Bootstrap release in a fresh project, it is advisable to refer to this informative discussion: Integrating Bootstrap 5 with Vue 3

The updated Bootstrap version now functions independently of jquery, eliminating the need for installing bootstrap-vue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there any way I can verify the invocation of signOut in this Jest test case?

I am attempting to perform testing on my home page within a next app. However, I have encountered an issue with a button in the Home component that triggers a logout firebase function. Despite my attempts to mock this function and verify whether or not i ...

Breaking down an object using rest syntax and type annotations

The interpreter mentions that the humanProps is expected to be of type {humanProps: IHumanProps}. How can I properly set the type for the spread operation so that humanPros has the correct type IHumanProps? Here's an example: interface IName { ...

"Error message: TypeORM DataSource encounters a password issue with the client

Here is the content of my data-source.ts file: import {DataSource} from "typeorm"; import path from "path"; import {User} from "./entity/User"; import { config } from "dotenv"; config(); export const AppDataSource ...

Using the increment operator within a for loop in JavaScript

this code snippet causes an endless loop for (let i = 0; ++i;) { console.log(i) } the one that follows doesn't even run, why is that? for (let i = 0; i++;) { console.log(i) } I want a thorough understanding of this concept ...

A special function designed to accept and return a specific type as its parameter and return value

I am attempting to develop a function that encapsulates a function with either the type GetStaticProps or GetServerSideProps, and returns a function of the same type wrapping the input function. The goal is for the wrapper to have knowledge of what it is ...

Powering up your React components with MDX, Storybook, and Typescript!

Currently, I am attempting to incorporate MDX markup into the creation of live documentation for my storybook. However, upon running the storybook, an error is occurring: Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: C ...

webpack - compile one TypeScript file separately (2 actions)

In summary... When my Vue files are combined with background.ts, webpack processes them to create bundled vue files along with background.js I'm unable to run the background.js script I expected background.js to only contain "console.log(' ...

Turn off Vuetify designs specifically for Katex elements - Using common classes such as .accent can cause problems with styles

I have encountered an issue while using Katex with Vuetify. Certain classes such as accent or overline are causing conflicts between the two libraries, resulting in strange styling inconsistencies. For example, the overline characters are inheriting the ac ...

Enhancing fullcalendar with Vue Js: A step-by-step guide

Issue: I am facing a challenge in customizing my Full calendar view. Objective: My goal is to set the default view to month. While I have achieved this using JQuery, I am curious about how to accomplish the same with Vue-js. My Investigation: My JQuer ...

What is the best way to convert JSON into a complex object in Typescript and Angular?

In my Typescript class for an Angular version 5 project, I have a JavaScript function that generates a style object. Here is the function: private createCircle(parameters: any): any { return new Circle({ radius: parameters.radius, ...

There is an issue with the type candidate in the Notion API, resulting in

In this instance, the troublesome code causing issues is displayed below: import {Client, LogLevel} from "@notionhq/client"; const notion = new Client({ auth: process.env.NOTION_TOKEN, logLevel: process.env.NODE_ENV !== 'product ...

Building on the powerful foundation of Laravel 5.3, we have crafted a seamless Vue 2.0 form for

I'm encountering difficulties with user authentication using Vue 2.0. Within my Vue application, I have a form where users input their information and submit it via POST to a Laravel endpoint. Once the user is created in the UserController method wi ...

Incorporating a custom transpiled file format into Typescript imports

I am trying to import a file format .xyz that does not have fixed types for all instances of the format: import { Comment, Article, User } from "./Blog.xyz" However, I keep getting this error message: TS2307: Cannot find module './Blog.xy ...

TypeScript compiler not processing recently generated files

While working on a project using TypeScript, I've noticed that the files compile without any issues when using tsc with the watch flag to monitor changes. However, I have run into an issue where when I create a new file, tsc does not automatically det ...

In what way can TS uniquely handle each element of an array as the key of an object?

I am struggling with an object that I need to have keys representing every item in the array, each linked to a value of any. Can anyone provide guidance on how to achieve this? Unfortunately, I couldn't find a solution. Here is an example for refere ...

What is the best way to determine the actual height of a DOM element that is being hidden by the overflow property in order to create a seamless CSS transition to height: auto

Solution: Thanks to @Kalimah, here's a solution that works in composition api & script setup: <script setup> const state = reactive({ meetCardHeight: 100 }) const element = ref(null) const changeElementHeight = () => { if (stat ...

Displaying Firebase data using Angularfire2 5.0 on an Ionic template

Hey everyone, I've been encountering a problem while trying to use angularfire2 v 5.0. I was comfortable using v 4.0 before, but now that I'm transitioning to v 5.0, I'm facing some issues. Does anyone know how I can display real-time data ...

Utilize the three.js library within a Vue component by importing it and incorporating its

Can someone please help me understand the proper way to import and utilize the three.js library in a vue component? Despite my extensive research, it seems that most individuals use the following code line to import three.js into a vue component. However, ...

The letter 'X' is not suitable for use as a JSX component because its return type 'Element[]' does not qualify as a valid JSX element

Currently, I am working on rendering two simple joke cards in TypeScript. The cards are displaying correctly in my browser, but I've encountered an error message that says: 'Jokes' cannot be used as a JSX component. Its return type 'Ele ...

Tips for effectively jasmine testing with the createSpyObj function, where class properties are defined as spies

When attempting to create a mock service with set-only properties, I encountered errors indicating that the value was undefined despite following the guidance in the documentation here. I want to be able to track the values of these properties during test ...