gajus / usus

Webpage pre-rendering service. ⚡️
Other
805 stars 33 forks source link

Unexpected token error #15

Closed crazy4groovy closed 6 years ago

crazy4groovy commented 7 years ago
c:\Temp\render>usus render --url http://myreactsite.com
C:\Users\me\AppData\Roaming\npm\node_modules\usus\node_modules\bluefeather\dist\map.js:9
const map = async (values, mapper, configuration) => {
                  ^
SyntaxError: Unexpected token (
    at createScript (vm.js:56:10)
. . .

node --version v6.10.2

Probably just need to define the version of node required (v7+) in the dependencies

gajus commented 7 years ago

This should be fixed in https://github.com/gajus/bluefeather.

As a temporary fix, I've increased the required version to v7.

ryansully commented 6 years ago

Is this due to async keyword? Perhaps babel-plugin-transform-async-to-generator could be added as a dependency? Then Node v6 could be supported.

gajus commented 6 years ago

Is this due to async keyword? Perhaps babel-plugin-transform-async-to-generator could be added as a dependency? Then Node v6 could be supported.

Good idea!

I really didn't want to add babel-runtime as dependency, but transforming async to generator is a good solution.