Transform Object Rest Spread: Unexpected Token #326
Comments
Can you post the code that is erroring? it's hard to not if you have a config error, theres a bug in Babel, or your syntax is wrong |
Yeah, for sure:
|
What's your webpack config? |
|
Same here.
|
@yiwan env doesn't include anything < Stage 4 like object rest spread so you need that plugin individually http://babeljs.io/docs/plugins/transform-object-rest-spread/#example |
@hzoo Haven't update version for a while, I should check babel's doc first 😔, but thanks. |
@hzoo Yes, I know. As you can see above in my first post, I have explicitly included the plugin for |
Same here: To create an electron & react application I was using the react and node7 presents as follows (which works)
|
@thesublimeobject he was talking to @yiwan re: missing object-rest-spread plugin. Is there anyway you can create a repro that reproduces the issue, it would greatly help in debugging! @DrYSG as @hzoo mentioned, the object rest spread transform is not included in this preset, so you should add the plugin to your babel config. |
@existentialism Yeah...it's a pretty big WP project though, so let me see if I can reduce it down to a smaller reproducible instance that I can throw on a repo somewhere. |
Closing for inactivity and lack or repo for now - again want to note object rest spread isn't in this preset until #91 happens (its not ES7, or ES2015, it's Stage 3 and not in JS yet) |
Apparently, unless If you want to destructure in parameters, you need to further add |
|
@line0 is there a particular order you're loading them in to get it to work? |
TL;DR;
|
I cannot get
transform-object-rest-spread
to work, and have tried several different methods. I continue to get the following error:I have tried both using .babelrc, and using the options configuration inside my webpack config. The odd thing is, I am running my webpack config through a gulp/browserSync build, whereas one of my other projects that uses pure NPM scripts has no issues. But, my gulp configuration is really doing nothing more than trigger an instance of browsersync which is running in conjunction with webpack-dev-server, so it shouldn't matter as far as I know. My configuration is as follows:
.babelrc
In addition, I have made note of the "Caveat" at the bottom of the the .README, and the version I am using is > 6.19.0. I'm really out of ideas. Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: