academind / yt-graphql-react-event-booking-api

Code for GraphQL + React Event Booking API Series: https://academind.com/learn/node-js/graphql-with-node-react-full-app/
395 stars 302 forks source link

Rest Spread (...) operator throws SyntaxError on usage #2

Closed shantanoo-desai closed 5 years ago

shantanoo-desai commented 5 years ago

Usage

 return { ...result._doc };

Throws a SyntaxError: Unknown Token. The repository does not provide any .babelrc for ECMA6Script configuration.

IDE/OS

Webstorm 2018.3 / Windows 10

This bug is not related to any particular IDE but from Node itself

Related StackExchange Query

shantanoo-desai commented 5 years ago

Problem can be solved by upgrading node version from v8.0.0 to v10.5.0 and setting up Babel transpiling files and packages mentioned in the StackExchange Query's Answer.