Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UglifyJS throw 'Invalid assignment' error #90

Closed
jmorrice opened this issue Jun 21, 2017 · 10 comments
Closed

UglifyJS throw 'Invalid assignment' error #90

jmorrice opened this issue Jun 21, 2017 · 10 comments

Comments

@jmorrice
Copy link

Hi,

Thanks for this awesome library!

I'm creating a component library using an nwb boilerplate (https://github.com/insin/nwb/blob/master/docs/guides/ReactComponents.md#developing-react-components-and-libraries-with-nwb).

Once I added react-element-to-jsx-string the build fails with the following error:

Failed to compile with 1 error.

 ERROR  in demo.1990f3e7.js from UglifyJs
Invalid assignment [./~/stringify-object/index.js:6,0][demo.1990f3e7.js:11007,34]

Is this an issue with stringify-object?

@vvo
Copy link
Contributor

vvo commented Jun 26, 2017

Is this an issue with stringify-object?

Yes this is the case, search on their repo and let us know!

@jmorrice
Copy link
Author

Already checked and was unable to find anything, that's why I submitted it here. Any ideas what could be causing this?

@vvo
Copy link
Contributor

vvo commented Jun 26, 2017

uglifyjs does not supports minifying ES2015 (this is sad) and stringify-object is not transpiled to ES5.

image

I found this on uglifyjs website, maybe try https://github.com/mishoo/UglifyJS2/tree/harmony and let me know!

@vvo
Copy link
Contributor

vvo commented Jun 26, 2017

Or try this: https://github.com/babel/babili

@vvo
Copy link
Contributor

vvo commented Jul 21, 2017

Reopen another issue if you still have the issue, with a repro repository

@vvo vvo closed this as completed Jul 21, 2017
@cedricdelpoux
Copy link

cedricdelpoux commented Jul 31, 2017

@jmorrice I have the same issue, what was your solution?

The only way I found was to disable uglifyJS from nwb config

@cedricdelpoux
Copy link

the bug is not present with the original repo https://github.com/alexlande/react-to-jsx

@vvo
Copy link
Contributor

vvo commented Jul 31, 2017

The only way I found was to disable uglifyJS from nwb config

This seems to be the way to go, you could also ask nwb to use the latest uglifyjs on their repo because more and more libraries will start shipping ES6

@cedricdelpoux
Copy link

Thank you, I asked for it

@jmorrice
Copy link
Author

jmorrice commented Aug 7, 2017

Thanks guys!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants