I want to use bs treeview.js library in my laravel project and i don't know how to do it. So far I have done the following:
npm install --save bstreeview
I added require ('bstreeview'); in resources/js/app.js
When I try to compile it with npm run dev I get the
ERROR in ./resources/js/app.js Module not found: Error: Can't resolve
'./bstreeview' in (...)
What am I doing wrong?
i have check this package there is not index.js
so you can't import directly you can include file like this
import 'bstreeview/dist/js/bstreeview.min.js';
require ('bstreeview'); it's means node is looking for index.js insde
node_module/bstreeview/index.js but in this package it is not there so u need to manually import like above mentioned
for
jquery
run npm i jquery
and inside bootstrap.js add this
window.$ = window.jQuery = require('jquery');
Related
Every day, I come to my office, launch my IDE (Code - OSS) and run npm run watch. Every day it works like a charm. But not today. Oddly enough, today running npm run watch fires this error:
ERROR in multi vue
Module not found: Error: Can't resolve 'vue' in
'/home/TopSecretUser/Code/Local/TopSecretProject/11.11.2020/dev'
# multi vue /js/vendor[0]
ERROR in ./resources/js/app.js
Module not found: Error: Can't resolve 'vue' in
'/home/me/Code/Local/TopSecretProject/11.11.2020/dev/resources/js'
# ./resources/js/app.js 3:13-16 4:0-22 6:0-3 85:14-17
# multi ./resources/js/app.js ./resources/css/app.css
My app.js starts with the following lines:
require("./bootstrap");
import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
...
I haven't made any changes from yesterday to today, so I am totally confused. I tried some fixings but nothing worked. Does anyone have any suggestion how i can fix this? I am using vue#2.6.11.
You could delete the node_modules which could be affected by an external action like deletion/moving or you mis-installed a module, then rerun :
npm install
this will fetch the dependencies in package.json and install them, you should always install a module by adding --save or --save-dev flag with npm i like npm i some-module --save
guys I had this issue, after a while I found the solution , just import component as this:
Vue.component('Date',required('components/Date.vue'));
it's my pleasure to follow me on instagram: https://www.instagram.com/mahdiabedi220/
I want to install MDB Vue in my fresh Laravel application Im trying to do it via npm but it's not working
I did :
1- created fresh Laravel app
2- Go to the directory www/myApp
3- npm install
4- npm install --save mdbvue
5- npm install --save-dev babel-preset-stage-2
6- I open app.scss
and add:
// Material Design Bootstrap
#import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
#import '~bootstrap/scss/bootstrap';
#import "~mdbvue/build/css/mdb.css";
7- I open ressources/js/bootstrap.js
I add:
try {
window.Popper = require('popper.js').default;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
require('mdbvue'); // I added this!
} catch (e) {}
it require('mdbvue') I notice a message in the picture:
https://i.imgur.com/IkKvXkb.jpg
I can't post it need more reputations
I keep going I did
8- npm run dev
Everything is green and looking fine but when
I go take MDB buttons in exemple and put themes in my view it's not working
did I missed something ? help please
Your have to add your imports in the app.js file.
import 'bootstrap-css-only/css/bootstrap.min.css';
import 'mdbvue/build/css/mdb.css'
For me it works without the require('mdbvue'); in the bootstrap.js.
But i think the reason you did´nt get an answer for your question is, there are other problems with the integration of mdbvue into the laravel environment.
For example i have not found a way yet to import fontawesome from my npm-installation folder import '#fortawesome/fontawesome-free/css/all.min.css';.
But when i add <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"> to my html-head, fontawesome works.
If i find some solutions, i will update this post.
Hope i could help you a bit.
I had the same issue, I could solved it like this:
Cd into your project
Run: npm install
Run: npm install mdbvue
Add the following code to your 'resources/js/app.js' file:
require('./bootstrap');
import '#fortawesome/fontawesome-free/css/all.min.css'
import 'bootstrap-css-only/css/bootstrap.min.css'
import 'mdbvue/lib/css/mdb.min.css'
Add the following code to your 'resources/js/bootstrap.js' file:
require('mdbvue');
Run: npm run dev
It worked for me, using laravel 5.8.35 and the lastest version of MDVUE.
I try to create a custom plugin. Wheni import Image from '#ckeditor/ckeditor5-image/src/image' i get an error
This dependency was not found:
* -!../../../css-loader/index.js??ref--6-oneOf-3-1!../../../postcss- loader/src/index.js??ref--6-oneOf-3-2!./#ckeditor/ckeditor5-theme- lark/theme/mixins/_rwd.css in ./node_modules/css-loader??ref--6-oneOf-3-
1!./node_modules/postcss-loader/src??ref--6-oneOf-3-
2!./node_modules/#ckeditor/ckeditor5-image/theme/textalternativeform.css
To install it, you can run: npm install --save -!../../../css-
loader/index.js??ref--6-oneOf-3-1!../../../postcss-loader/src/index.js??
ref--6-oneOf-3-2!./#ckeditor/ckeditor5-theme-lark/them
How should i fix it? I've installed this package https://github.com/ckeditor/ckeditor5-theme-lark and there is no effect.
Make sure you have created the vue.config.js file and included the details from
https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html
Make sure #ckeditor/ckeditor5-theme-lark is installed
npm install --save #ckeditor/ckeditor5-theme-lark
That should then fix the issue
after modified the vue.config.js make sure you are re-run again your VUE application
npm run dev
or
npm run serve
In my case, I got same error because I did not follow the guide very well. After read it I had to run this:
npm install #ckeditor/ckeditor5-theme-lark
npm install --save #ckeditor/ckeditor5-vue2 #ckeditor/ckeditor5-dev-webpack-plugin #ckeditor/ckeditor5-dev-utils postcss-loader#4 raw-loader#4
For specific modules selected, something like this:
npm install --save #ckeditor/ckeditor5-basic-styles #ckeditor/ckeditor5-editor-classic #ckeditor/ckeditor5-horizontal-line #ckeditor/ckeditor5-alignment #ckeditor/ckeditor5-autosave #ckeditor/ckeditor5-adapter-ckfinder #ckeditor/ckeditor5-essentials #ckeditor/ckeditor5-font #ckeditor/ckeditor5-heading #ckeditor/ckeditor5-image #ckeditor/ckeditor5-indent #ckeditor/ckeditor5-link #ckeditor/ckeditor5-list #ckeditor/ckeditor5-paragraph #ckeditor/ckeditor5-paste-from-office #ckeditor/ckeditor5-remove-format #ckeditor/ckeditor5-typing #ckeditor/ckeditor5-basic-styles
Then, in my case I use VUE 2+ version, so I had to modify the vue.config.js file, accorging the official documentation: https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/frameworks/vuejs-v2.html
Plase check the documentation with your specific framework: https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/frameworks/overview.html
I have clear Laravel 5.7 installation and I need to install izimodal package
So I have installed by npm install izimodal.
For the next step, I initialized this package in my /resources/js/bootstrap.js like:
import iziModal from 'izimodal/js/iziModal';
$.fn.iziModal = iziModal;
and run npm run dev to compile app.js
At this stage, the package was successfully imported and working but I missing CSS part of izimodal... How can I correctly initialize this package with CSS? I have tried this code in my webpack.mix.js but it does not work:
mix.copy('node_modules/izimodal/css/iziModal.css', 'resources/css');
mix.styles([
'resources/css/reset.css',
'resources/css/style.css'
], 'public/css/app.css');
Solved. Just added to my app.scss
// npm-package
#import "~izimodal/css/iziModal.css";
// Custom CSS
#import "../css/reset.css";
#import "../css/style.css";
I have installed ckeditor5 using npm in my laravel 5.6 project ( npm install --save #ckeditor/ckeditor5-build-classic) then i added window.ckeditor = require('#ckeditor/ckeditor5-build-classic');
to my resources/assets/js/app.js and ran npm run dev.The compilation was successfull.
In my view when i try to reference ckeditor, it says it cannot find ckeditor. please help
here is my resources/assets/js/app.js
require('./bootstrap');
window.Vue = require('vue');
/* tried both of these options one by one*/
window.ckeditor = require('#ckeditor/ckeditor5-build-classic');
// import ClassicEditor from "#ckeditor/ckeditor5-build-classic";
Try import ClassicEditor from "#ckeditor/ckeditor5-build-classic";
Installing Instructions
Try using the following:
const ClassicEditor = require( '#ckeditor/ckeditor5-build-classic' );