Topic: Laravel/Vue: Cannot find module 'mdbvue'

fredemagi pro asked 5 years ago


I'm trying to use MDBootstrap Vue in Laravel. npm install mdbvue. After installation, I have imported the scss file into app.scss, so it now looks like

@import url('https://fonts.googleapis.com/css?family=Nunito');

@import 'variables';

@import '~bootstrap/scss/bootstrap';

@import "~mdbvue/build/scss/mdb";

The app.js file looks like:

require('./bootstrap');

window.Vue = require('vue');

require('mdbvue');

When I try to use a simple table, it yields the error in the title (not found module). An example-component with the table would be with this: https://mdbootstrap.com/content-2/tables/ or this https://mdbootstrap.com/docs/vue/tables/basic/.

I cannot figure out how to use the table from the first link, and when I try with the table from the second link (with template-tags and script-tag), it yields the module mdbvue could not be found. Where do I go from here?

EDIT: Now I tried this guide https://stackoverflow.com/questions/51823924/how-to-load-mdbootstrap-vue-into-laravel-5-with-laravel-mix.

Now it yields the error Uncaught ReferenceError: TblBody is not defined


Jakub Strebeyko staff commented 5 years ago

Hi there @fredemagi, Thanks for reaching out! Apparently, the naming issue popped up in context of using mdbvue with Laravel already, and I feel it has been pretty much covered here, as far as I remember following the instructions on the bottom resulted in a Laravel project with bootstrapped mdbvue. It has not been thoroughly tested yet, though - please check whether it helps to import the components correctly - it may solve the issue and in case it doesn't - we'll take it from there.

Best, Kuba


fredemagi pro commented 5 years ago

It seems to be working now. I have gotten the tables to work aswell by referencing the correct names in the components-section of export.


Jakub Strebeyko staff commented 5 years ago

So happy! Did you follow the tutorial, or maybe there there is something else you've done to have it working? This insight would surely benefit people facing the issue and could help us advance towards a proper tutorial in the matter, so thanks in advance. :)

Best, Kuba



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 5.1.1
  • Device: Computer
  • Browser: Google Chrome
  • OS: Windows 10
  • Provided sample code: Yes
  • Provided link: Yes