yuche / vue-strap

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

Browserify Failed!: Unexpected token, related to new spinner.scss #198

Open vesper8 opened 8 years ago

vesper8 commented 8 years ago

Getting this build error when running gulp since updating from the master to the 1.0.10 branch

Saving To...
   - public/js/app.js

[05:27:05] gulp-notify: [Laravel Elixir] Browserify Failed!: Unexpected token

/home/vagrant/DEV/www.mydomain.com/node_modules/vue-strap/src/spinner.scss:10
$brand-primary: darken(#428bca, 6.5%); // #337ab7
              ^
ParseError: Unexpected token

Any ideas why?

This is my package.json

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "bootstrap": "^3.0.0",
    "jquery": "^2.1.4",
    "js-cookie": "^2.1.0",
    "laravel-elixir": "^4.0.0",
    "moment": "^2.10.6",
    "promise": "^7.1.1",
    "sweetalert": "^1.1.3",
    "underscore": "^1.8.3",
    "urijs": "^1.17.0",
    "vue": "^1.0.21",
    "vue-resource": "^0.5.1",
    "laravel-elixir-vueify": "^1.0.3",
    "vue-strap": "^1.0.10"
  }
}
vesper8 commented 8 years ago

And this is my gulpfile.

Do I not currently support sass right now is that the problem? How do I fix it?

var elixir = require('laravel-elixir');

require('laravel-elixir-vueify');

elixir(function(mix) {
    mix.less('app.less')
       .browserify('app.js', null, null, { paths: 'vendor/laravel/spark/resources/assets/js' })
       .copy('node_modules/sweetalert/dist/sweetalert.min.js', 'public/js/sweetalert.min.js')
       .copy('node_modules/sweetalert/dist/sweetalert.css', 'public/css/sweetalert.css');
});
amanpatel commented 8 years ago

Good point. This is from the new spinner component. Will remove the sass dependency soon. In the mean time try a npm install.

On May 17, 2016, 12:35 AM -0500, vesper8notifications@github.com, wrote:

And this is my gulpfile.

Do I not currently support sass right now is that the problem? How do I fix it?

var elixir = require('laravel-elixir'); require('laravel-elixir-vueify'); elixir(function(mix) { mix.less('app.less') .browserify('app.js', null, null, { paths: 'vendor/laravel/spark/resources/assets/js' }) .copy('node_modules/sweetalert/dist/sweetalert.min.js', 'public/js/sweetalert.min.js') .copy('node_modules/sweetalert/dist/sweetalert.css', 'public/css/sweetalert.css'); });

— You are receiving this because you are subscribed to this thread. Reply to this email directly orview it on GitHub(https://github.com/yuche/vue-strap/issues/198#issuecomment-219623690)

loranger commented 8 years ago

I do use sass, but I have the ParseError too :

[11:48:46] gulp-notify: [Laravel Elixir] Browserify Failed!: Unexpected token

/Users/loranger/Developer/projects/awe/node_modules/vue-strap/src/spinner.scss:10
$brand-primary: darken(#428bca, 6.5%); // #337ab7
              ^
ParseError: Unexpected token

And my gulpfile :

var elixir = require('laravel-elixir');
require('laravel-elixir-vueify');

elixir(function(mix) {
  mix.sass('vendor.scss', null, { includePaths: ['node_modules/'] })
    .sass('awe.scss', null, { includePaths: ['node_modules/'] })
    .browserify('admin.js', 'public/js/admin.js')
    .browserify('awe.js', 'public/js/awe.js')
  ;
});

What can I do ?

amanpatel commented 8 years ago

I'll need some time to fix this. Can you try npm install in your project and see if it helps?

On May 17, 2016, 4:53 AM -0500, Laurent Goussardnotifications@github.com, wrote:

I do use sass, but I have the ParseError too :

[11:48:46] gulp-notify: [Laravel Elixir] Browserify Failed!: Unexpected token /Users/loranger/Developer/projects/awe/node_modules/vue-strap/src/spinner.scss:10 $brand-primary: darken(#428bca, 6.5%); // #337ab7 ^ ParseError: Unexpected token

And my gulpfile :

varelixir=require('laravel-elixir');require('laravel-elixir-vueify');elixir(function(mix) {mix.sass('vendor.scss',null, { includePaths:['node_modules/'] }) .sass('awe.scss',null, { includePaths:['node_modules/'] }) .browserify('admin.js','public/js/admin.js') .browserify('awe.js','public/js/awe.js') ; });

What can I do ?

— You are receiving this because you commented. Reply to this email directly orview it on GitHub(https://github.com/yuche/vue-strap/issues/198#issuecomment-219671648)

doonetheprune commented 8 years ago

@amanpatel I have created issue #196 which I think is the reason for this issue as well. If the package.json was changed back to the dist folder these issues would be solved.

vesper8 commented 8 years ago

fyi doing a npm install (or npm update) simply does nothing. nothing new gets installed or updated (with my package.json above) and the gulp error stays the same

loranger commented 8 years ago

Sorry, I'm just trying and, as @vesper8 said, npm install or update does not fix the issue.

lukpep commented 8 years ago

using npm and same error - with Alert.vue

build.js:18655 Uncaught SyntaxError: Unexpected token import

/***/ function(module, exports) {

    import alert from './Alert.vue'
    import carousel from './Carousel.vue'
    import slider from './Slider.vue'
    import accordion from './Accordion.vue'
    import affix from './Affix.vue'
doonetheprune commented 8 years ago

@vesper8 @loranger @lukpep PR #200 was merged yesterday however, I forgot to bump the version number so npm wont be picking up the change. Depending on how desperately you need vue-strap to work you could manually edit node_modules/vue-strap/package.json and change the main to "main": "dist/vue-strap.js", see this line

Hope that helps

lukpep commented 8 years ago

@doonetheprune - thx. I've did a rollback to 1.0.7 and will wait for 1.0.11 on npm

amanpatel commented 8 years ago

1.0.11 is now published. Please close the issue if it fixes it. yuche had accepted the change in package.json which changes the way people can use the package. It's now back to the way it worked before.

tverp commented 8 years ago

The issue is still here for me.

steven-klein commented 8 years ago

@tverp PR #212 has got this working for me.

antongorodezkiy commented 8 years ago

Have the same issue