Tools: Polymer cli don't support the spread operator (...) condition during build

Created on 24 Sep 2018  路  11Comments  路  Source: Polymer/tools

I just had this error during the build:

src/growspace/growspace-detailed-info.html(102,12) error [parse-error] - Unexpected token ...

for this kind of code:

this.$.modifyOneLightAjax.body = {
          "name": this.$.modifyLightNameInput.value,
          ...this.$.createLightDescriptionInput.value && {
            "description": this.$.createLightDescriptionInput.value
          },
          "type": this.$.createLightTypeInput.selected
        };

Thank you!

Most helpful comment

Also running into this in our project here. Does anyone have any news on this?

All 11 comments

Any help? This is blocking us & we have thousands of spread operators in our polymer project?

Related to #665

Related to #665

I don't think there is any relation with the #665 ...

Is there any build option that I can use to bypass the problem?

The relation is that both build and modulizer use analyzer under the hood and it apparently needs to be updated to parse object rest / spread properly.

Okay, thank you for the explanation! Is there any chance that the analyzer will be updated?

@rictic @usergenic could you help us with a hint about where to apply the proper fix to support object spread?

Probably adding this babel plugin should help: https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread

But I don't know how to do it...

I found that it's already included in the polymer-build tool

But I don't know why it's not working...

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Are there still no news on this? It's a serious blocker for big applications with many spread operators..

Also running into this in our project here. Does anyone have any news on this?

Hey guys! I'm also having the same. Are you going to fix this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lpellegr picture lpellegr  路  4Comments

idoshamun picture idoshamun  路  3Comments

stramel picture stramel  路  4Comments

emilbillberg picture emilbillberg  路  3Comments

rwatts3 picture rwatts3  路  3Comments