yuche / vue-strap

Bootstrap components built with Vue.js
http://yuche.github.io/vue-strap/
MIT License
4.72k stars 933 forks source link

Laravel Elixir Browserify Cannot find module #160

Open phuclh opened 8 years ago

phuclh commented 8 years ago

I am using vueify and try to import vue-trap like that:

import Alert from '/node_modules/vue-strap/src/Alert.vue'

But I got a error like this: Laravel Elixir Browserify Cannot find module. I double checked the path is correct. Please help me. Thank you so much !!!

prog-rajkamal commented 8 years ago

try import Alert from 'vue-strap/src/Alert.vue'

petercoles commented 8 years ago

You don't state the location of the file doing the import, but let's say that it's in a typical Laravel in the resources/assets/js folder. In this case you'd need to use

import Alert from '../../../node_modules/vue-strap/src/Alert.vue'
rtucek commented 8 years ago

Here is the solution for Laravel Elixir https://github.com/JeffreyWay/laravel-elixir-vueify cc: #159, #158

nbyloff commented 8 years ago

I tried this solution in Laravel. ran npm install vue-strap --save. Then in the same file where I have all my custom .vue files, I added require('vue-strap');. Same location where require('vue-resource'); is, and that works. But when I add vue strap, it spits out like 100 errors. Here is a sample of what is returned when I run gulp

[01:39:19] gulp-notify: [Laravel Elixir] Browserify Failed!: Cannot find module '-!babel!./../node_modules/vue-loader/lib/selector.js?type=script&index=0!./Alert.vue' from '/home/vagrant/code/node_modules/vue-strap/dist'
{ [Error: Cannot find module '-!babel!./../node_modules/vue-loader/lib/selector.js?type=script&index=0!./Alert.vue' from '/home/vagrant/code/node_modules/vue-strap/dist']
...
...
...
...
[01:39:19] gulp-notify: [Laravel Elixir] Browserify Failed!: Cannot find module '-!babel!./../node_modules/vue-loader/lib/selector.js?type=script&index=0!./checkboxGroup.vue' from '/home/vagrant/code/node_modules/vue-strap/dist'
{ [Error: Cannot find module '-!babel!./../node_modules/vue-loader/lib/selector.js?type=script&index=0!./checkboxGroup.vue' from '/home/vagrant/code/node_modules/vue-strap/dist']
...
...
...
...
[01:39:19] gulp-notify: [Laravel Elixir] Browserify Failed!: Cannot find module '-!vue-html-loader!./../node_modules/vue-loader/lib/selector.js?type=template&index=0!./Accordion.vue' from '/home/vagrant/code/node_modules/vue-strap/dist'
{ [Error: Cannot find module '-!vue-html-loader!./../node_modules/vue-loader/lib/selector.js?type=template&index=0!./Accordion.vue' from '/home/vagrant/code/node_modules/vue-strap/dist']
...
...
AND SO ON...
...
...

Essentially every component is failing to load. I even manually install vue-html-loader, vue-loader, etc.

prog-rajkamal commented 8 years ago

@nbyloff this is known issue. Hopefully it will be fixed soon. fix of this issue are mentioned in #159 they are 438c0f7 29c2422

Note: the changes are to be done in node_modules/vue-strap/package.json