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

TypeError: Cannot assign to read only property 'warnings' of true #298

Closed
rauberdaniel opened this issue Feb 12, 2015 · 10 comments
Closed

Comments

@rauberdaniel
Copy link

I recently updated to node 0.12.0 and right now I’m getting the following error with grunt-contrib-uglify version 0.7.0:

Running "uglify:min" (uglify) task
[TypeError: Cannot assign to read only property 'warnings' of true]
>> Uglifying source static/js/main.js failed.
Warning: Uglification failed.
Cannot assign to read only property 'warnings' of true.
 Use --force to continue.

Aborted due to warnings.

Happens with any .js file, so it seems to be a bug either with nodejs v0.12.0 or with this uglify task. Any ideas?

@rauberdaniel
Copy link
Author

I guess I found the reason: Having set the option compress to true instead of {} (which is allowed by documentation) causes the issue.

@oleksiipysanko
Copy link

+1! You saved my day, thanks!

@XhmikosR
Copy link
Member

Duplicate of #287.

evaneus added a commit to corespring/corespring-container that referenced this issue Mar 3, 2015
bbinet added a commit to bbinet/grafana that referenced this issue Mar 10, 2015
This patch fix the following uglify error:
TypeError: Cannot assign to read only property 'warnings' of true
Or we can upgrade grunt-contrib-uglify to latest v0.8.0 version which
should also fix the issue.

This issue has been reported on grunt-contrib-uglify bug tracker:
gruntjs/grunt-contrib-uglify#298
sh1989 pushed a commit to sh1989/angular-modularisation that referenced this issue Mar 13, 2015
compress: true breaks Node 0.1.2, as documented
gruntjs/grunt-contrib-uglify#298
@NorikDavtian
Copy link

👍 @rauberdaniel tnxx

@ahmednuaman
Copy link

So I had this problem too, but it was fixed by running git clean -xdf and npm install again.

andrezero pushed a commit to andrezero/grunt-jsglue that referenced this issue Apr 29, 2015
@4aficiona2
Copy link

replacing true with {} worked for me too. Thanks @rauberdaniel

@2013gang
Copy link

+1

@willthemoor
Copy link

Thank you @rauberdaniel!

@Deanzie
Copy link

Deanzie commented Sep 4, 2015

+1

@amccarthyMatchbook
Copy link

+1

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

10 participants