plouc / mozaik-demo

Sample mozaïk app with two dashboards
http://mozaik.rocks/
103 stars 75 forks source link

Demo v2 does not start #10

Closed jdeniau closed 7 years ago

jdeniau commented 7 years ago
item info notes
node version 5.11.1
npm version 3.8.6
mozaik-demo version mozaik-2 / 6afba6b
browser ~

Expected behavior

demo should start :D

Actual behavior

It does not start:

yarn start

trigger this error:

yarn start v0.17.10
$ node app.js 
/home/jdeniau/code/mozaik-demo/node_modules/mozaik/src/Mozaik.js:1
(function (exports, require, module, __filename, __dirname) { import winston from 'winston';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/jdeniau/code/mozaik-demo/app.js:4:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
error Command failed with exit code 1.

The problem I think is that the mozaik dependency is not "babelized" so the import does not work.

plouc commented 7 years ago

Yes, but the webpack config in the mozaik published version should include it

plouc commented 7 years ago

also note that Mozaïk requires Node v6

plouc commented 7 years ago

https://github.com/plouc/mozaik-demo/blob/mozaik-2/package.json#L15

plouc commented 7 years ago

@jdeniau have you tried running it with npm ?

jdeniau commented 7 years ago

Upgraded to node v7 and it seems to work :)

I tried with babel-node before and it worked too ;)

Probably due to the first install in node v5 without re-building my assets