react-framer icon indicating copy to clipboard operation
react-framer copied to clipboard

Unexpected spread operator in Webpack config

Open andrewliebchen opened this issue 7 years ago • 2 comments

When trying to run the example, Webpack complains it doesn't know about the spread operator:

/Users/liebchen/Desktop/react-framer/webpack.config.js:24
    ...base,
    ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at requireConfig (/Users/liebchen/Desktop/react-framer/node_modules/webpack/bin/convert-argv.js:97:18)

andrewliebchen avatar Dec 19 '17 05:12 andrewliebchen

Object spread only works with node.js >= 8.6.0 So the quickest fix is to upgrade your installed node.js version (You can check your current version by typing node -v in the terminal).

Better solution is to use Object.assign() for better compatibility with older node.js versions. I will make a pull-request if the issue is still present on the weekend 🙂

ofhouse avatar Dec 20 '17 22:12 ofhouse

That works 😄 . Or an .nvmrc. But maybe Object.assign() is better since not everybody using this will have nvm.

dabbott avatar Dec 20 '17 23:12 dabbott