JeffreyWay / laravel-elixir-vueify

This is a very thin wrapper for Laravel Elixir and the Browserify Vueify plugin.
156 stars 30 forks source link

Elixer 6.0.0 build: SyntaxError: Unexpected token ) #31

Closed ryanrca closed 7 years ago

ryanrca commented 8 years ago

I had to run this after installing laravel-elixir-vueify: npm install laravel-elixir That seemed to work okay, reporting "testing binary. Binary is fine; exiting."

But now gulp errors with this:

> gulp
/home/ryan/repos/sm3.0/source/node_modules/laravel-elixir-vueify/index.js:3
Elixir.ready(() => {
              ^
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/ryan/repos/sm3.0/source/curator.gulpfile.js:3:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

And this is my gulp file:

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

/**
*  The music accepter application
**/
    elixir(function(mix) {
        mix.browserify('resources/assets/js/accepter/accepter-app.js');                                                                   
    });
ryanrca commented 8 years ago

Follow up: I downgraded laravel-elixir to the following versions in package.json:

 "laravel-elixir": "^4.0.0",
 "laravel-elixir-vueify": "^1.0.0",

Now gulp runs, but with this error:

[23:01:14] Finished 'default' after 716 ms
[23:01:20] gulp-notify: [Laravel Elixir] Browserify Failed!: Couldn't find preset "react" relative to directory "/home/ryan/repos/sm3.0/source/resources/assets/js/accepter" while parsing file: /home/ryan/repos/sm3.0/source/resources/assets/js/accepter/accepter-app.js
JeffreyWay commented 8 years ago

What does node -v and npm -v return for you?

ryanrca commented 8 years ago

node -v v0.12.15

npm -v 3.10.8

I started over with a clean directory, it's still reproducing. Here is the list of commands I ran:

> cd elix2
>  rm -rf *
>  npm install laravel-elixir-vueify
>  npm install gulp
>  npm install laravel-elixir
>  vi gulpfile.js
>  gulp

Error:

> gulp
/srv/elix2/node_modules/laravel-elixir-vueify/index.js:3
Elixir.ready(() => {
              ^
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/srv/elix2/gulpfile.js:3:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
rogervila commented 8 years ago

Looks like your node version does not read ES6. Try to update your Node version (I recommend to do it with Nvm)

ryanrca commented 7 years ago

This is very old and I no longer reproduce it. So I will close for you :)