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

'Beautify' does not appear in command palette: 'unsafe-eval' error caused by Analytics-Node library #114

Closed
danhawkes opened this issue Oct 3, 2014 · 7 comments
Assignees
Milestone

Comments

@danhawkes
Copy link

Running 0.13.2 in atom 0.135.0.

Having uninstalled a few (of what I thought were) unrelated packages, beautify is no longer showing up in the command palette.
It is appearing in the 'Packages' window menu, but selecting the 'Beautify' item has no effect.

No errors are generated, and as a last-ditch effort I've also tried reinstalling atom/the plugin and wiping the ~/.atom directory.

I'm out of ideas, so any help debugging the cause would be appreciated!

@antoniomika
Copy link

This occurs due to an unsafe eval in analytics-node. I forked and created a really hacky workaround (https://github.com/antoniomika/atom-beautify). To use this, just clone the repo into your .atom/packages folder and run npm install inside of the directory.

What this looks like:

cd ~/.atom/packages
git clone https://github.com/antoniomika/atom-beautify.git
cd atom-beautify
npm install

Please remember this is not a proper fix, just a quick workaround.

@furins
Copy link

furins commented Oct 5, 2014

+1 I've also disabled the offending code in a similar way (removing the analytics ID from the settings and changing lib/language-options.coffee in order to check if an analytics id is set and then loading the analytics-node code only in that case). I'm unsure if analytics-node can be fixed in order to solve this issue: if not, the only feasible way to solve it is to change the way analytics statistics are collected, or removing them at once as suggested by @antoniomika. This is a decision up to @Glavin001 but until then we have to use a different repo.

@Glavin001
Copy link
Owner

We should be able to use loophole for wrapping unsafe eval code. I have a number of issues I will try getting around to resolving today now that I am home. Thank you all for your patients.

@Glavin001
Copy link
Owner

Please try v0.13.3 and let me know if this resolves your issue.

@Glavin001 Glavin001 added this to the v1.0.0 milestone Oct 5, 2014
@furins
Copy link

furins commented Oct 5, 2014

Thank you @Glavin001 It works like a charm now :)

if somebody else wants to check, before 0.13.3 is out, here is what I've done in order to test it:

cd ~/.atom/packages
rm -r atom-beautify
git clone https://github.com/Glavin001/atom-beautify.git
cd atom-beautify
git checkout v0.13.3
apm update

and reloaded everything (View>Reload)

@Glavin001
Copy link
Owner

Glad to hear it worked! I was actually unable to reproduce, but I used the error reported from issue #113 to narrow down the problem.

v0.13.3 is published to Atom already.

I always recommend a Reload after updating, I've had problems in the past where bugs were reported that were already resolved or appeared because of cached resources and a reload was required.

Thank you all again for your patients and please let me know if there are any more issues your have.

@Glavin001 Glavin001 changed the title 'Beautify' does not appear in command palette, 'Packages->Beautify' has no effect 'Beautify' does not appear in command palette: 'unsafe-eval' error caused by Analytics-Node library Oct 5, 2014
@danhawkes
Copy link
Author

Working for me in 0.13.4. Thanks to all for quick responses.

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