Vue 3 does not currently support the usage of Bootstrap components

Currently, I am diving into the world of Vuejs and experimenting with integrating bootstrap/vue-bootstrap components like Card or b-table. However, I encountered some issues along the way.

[Vue warn]: Failed to resolve component: b-table If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement. at

Upon attempting to import components in the javascript file, I faced the following error:

[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to handle .vue files.

I followed the suggestion to install @vitejs/plugin-vue as mentioned above, but unfortunately, the issue persisted.

Here's a snippet of my code:

  <header>toDoList</header>
  <b-table striped hover :items="list"></b-table>
  <input v-model="newTask">
  <input v-model="newTaskDate">
  <button @click="addnewTask()">add new Task</button>
</template>

<script>
import { BTable } from bootstrap-vue;
export default {
  data() {
    return {
      list: [{name:"Doing something",date:"1"}],
      newTask: '',
      newTaskDate: ''
    }
  },
  methods: {
    addnewTask() {
      this.list.push({name:this.newTask, date:this.newTaskDate})
    }
  }
}
</script>

In my main.js file:

import App from './App.vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'

import './assets/main.css'

createApp(App).mount('#app')

Answer №1

MaterializeCSS currently does not offer compatibility with the latest Vue 3 version.
If you want to use MaterializeCSS with Vue 3, you must utilize the Migration Build.

Be sure to visit the initial support for Vue.js 3.x and adjust your setup accordingly for smooth integration.

Answer №2

There may have been a mistake on your end, but have you considered this alternative? Pay attention to the quotation marks in the import statement.

import { BTable } from '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 a way to retrieve random data based on either product id or slug within a single component using useQuery? Currently, all components are displaying the same data

Here is the code I wrote: const fetchCartItem = async () => { if (token) {const {data } = await axios.get(API.GET_PRODUCT_DETAILS_BY_PRODUCT_ID.replace("[ProductID]",item?.ProductID),{headers:{Authorization: token,},});setCartLoading(fal ...

Create a Bootstrap Modal that is positioned relative to a specific column

My design consists of 3 columns, and I need to insert a modal into the second column. The challenge is ensuring that the modal stays within the confines of the 2nd column when the screen size changes, specifically for desktop sizes ranging from 1922x1080 t ...

When utilizing backend Node.js with MongoDB, the patch request is unable to successfully update date type values

Using node.js, I have created the backend and integrated MongoDB for data persistence. However, I am facing an issue where I am unable to update the field of date type when making a patch request. Below is the code snippet for handling patch requests in t ...

Error: Vue.js application requires the "original" argument to be a Function type

I am facing an issue when trying to call a soap webservice using the 'soap' module in my Vue SPA. Strangely, I encounter an error just by importing the module. Despite my extensive search efforts, I have not been able to find a solution yet. Her ...

Update data in the datatables using values from an array list

Currently, I have two HTML files where I am loading data using JSON and then applying jQuery datatables to them. Now, I need to refresh the data with new parameters. For example: JSON: [ {"name":"jon","sales":"100","set":"SET1"}, {"name":"charlie","sale ...

The challenge in displaying data from the backend using ajax in Vue.js 2.0 is hindering its visibility on the view

Currently, I am utilizing vue.js version 2.0, and the demo provided below is fully functional. <div class="container" id="app"> <ol> <li v-for="(todo,index) in todos"> {{ index }} {{ todo.text }} </li&g ...

What seems to be causing the malfunction in this ranking function?

I created a custom function to retrieve the top five users from a JSON database. Below is the code snippet: var users = []; Object.keys(database).forEach(user => { if (!users[0]) { users[0] = user } else { var checked = false; for (let ...

Opening a file upon launching in Nativescript-Vue: A step-by-step guide

After following the steps outlined in this article, my app is successfully able to open a file with a simple click. Upon launching the application, I see the following message in my console.log: (Foundation) [com.apple.foundation.filecoordination:claims] ...

The operation to add a new user timed out after 10 seconds while buffering in the mongooseError

It appears that when I run mongoose in this code, it doesn't seem to connect to my local MongoDB database in time. The error message "mongooseError: Operation users.insertOne() buffering timed out after 10000 ms" is displayed if the insert operation i ...

Adding individual names for elements in a list using Jackson

Is there a way to assign a unique name to each element in a JSON list using JACKSON? For instance, consider the following JSON data: {"result": [ { "name": "ABC", "age": "20" },{ "name": "DEF", "age": "12" } ]} Howeve ...

No Access-Control-Allow-Origin or Parsing Error with jQuery

I am attempting to use ajax from a different server to request data from my own server as a web service. The response is a valid json generated by json_encode. {"reference":"","mobile":"","document":"","appointment":""} To avoid the 'Access Control ...

Displaying JSON data in HTML using Angular

If you have a straightforward controller: controller: function($scope, $http){ $http.get(templateSource+'/object.customer') .then(function(result){ $scope = result.data; }); } The content of my object.customer file is a ...

Adding Roles Using Discord.js - A Simple Guide

I'm currently working on a Discord bot using Discord.js, and I am trying to implement a feature where users can use a command to assign themselves a role. However, despite my best efforts, I am unable to get this functionality to work. In my bot' ...

Exploring potential arrays within a JSON file using TypeScript

Seeking guidance on a unique approach to handling array looping in TypeScript. Rather than the usual methods, my query pertains to a specific scenario which I will elaborate on. The structure of my JSON data is as follows: { "forename": "Maria", ...

Struggling to update the previousCode state with the useState hook in React

I'm having trouble understanding why the state isn't changing when using setPreviousCode in React and JavaScript. I'm trying to store the previously scanned text in the variable previousCode. import React, { useEffect, useState } from " ...

Click on the button to automatically scroll to a specific component inside the dialog

In my JSF/Primefaces application, I have a page with a long content that can be scrolled, along with a dialog also containing lengthy content that requires scrolling. The dialog includes a button and I am looking to scroll the dialog content to a specific ...

Redirect events in Backbone views

Is there a way to navigate to a different page when a specific event is triggered in a View using Backbone? events: { 'click .btn': 'signin' }, render: function() { tmp = this.template(); this.$el.html(tmp); }, signin: func ...

The auto complete feature seems to be malfunctioning as an error message is being displayed stating that iElement.autocomplete is not

I am currently attempting to create an auto complete feature for a search text box using Angularjs. However, I am encountering an error stating that iElement.autocomplete is not a function. Here is the code snippet: <body ng-controller='Friend ...

Display an aspx page within a div container

I am using the following code to load an aspx page in a div tag. Unfortunately, it's not working as expected. Can someone please assist me in resolving this issue? <script type="text/javascript"> $(document).ready(function () { $(&a ...

How can I load only specific images on a webpage using HTML?

I attempted to implement an image filter for my website by using the code below: <script> function myFunction() { // Initialize variables var input, filter, ul, li, a, i; input = document.getElementById('myInput'); filter = input.value.toU ...