ivan-kleshnin / tetris-game

Tetris game implemented in CycleJS
MIT License
16 stars 4 forks source link

Can't start dev server, Unexpected token import #3

Closed Widdershin closed 8 years ago

Widdershin commented 8 years ago

To reproduce:

 $ npm install
 $ npm run dev

> tetris-cyclejs@0.1.0 dev /Users/nickj/Projects/tetris-cyclejs
> webpack-dev-server --config webpack.config-dev.js --progress --colors --port 2992 --inline

/Users/nickj/Projects/tetris-cyclejs/webpack.config-dev.js:1
(function (exports, require, module, __filename, __dirname) { import Path from "path";
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at module.exports (/Users/nickj/Projects/tetris-cyclejs/node_modules/webpack/bin/convert-argv.js:80:13)
    at Object.<anonymous> (/Users/nickj/Projects/tetris-cyclejs/node_modules/webpack-dev-server/bin/webpack-dev-server.js:55:48
)
    at Module._compile (module.js:425:26)

I imagine this is because of Babel 6? But I'm not really sure how es6 webpack configs are supposed to work.

ivan-kleshnin commented 8 years ago

Yes, this is because of Babel. I didn't find enough time to verify installation steps for this project. But I'm going to continue in a while. Thank's for information @Widdershin, I'll take a look and fix it.

ivan-kleshnin commented 8 years ago

Everything were ok, I just forgot to attach proper installation instructions. You basically need to run bin/install from the project folder. It patches Webpack configurations (among other things) which allows ES2015 syntax there.