Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Failed to activate the atom-beautify package #849

Closed amkarthik closed 8 years ago

amkarthik commented 8 years ago

I am Unable to use this package While using the keystroke it shows the error message The trace back was

TypeError: Beautifiers is not a function at Object. (/home/harmony-12/.atom/packages/atom-beautify/src/beautify.coffee:10:18) at Object. (/home/harmony-12/.atom/packages/atom-beautify/src/beautify.coffee:2:1) at Module._compile (/opt/atom/resources/app.asar/src/native-compile-cache.js:103:30) at Object.defineProperty.value as .coffee at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Module.require (module.js:365:17) at require (/opt/atom/resources/app.asar/src/native-compile-cache.js:50:27) at Package.module.exports.Package.requireMainModule (/opt/atom/resources/app.asar/src/package.js:720:27) at Package.module.exports.Package.activateNow (/opt/atom/resources/app.asar/src/package.js:172:16) at /opt/atom/resources/app.asar/src/package.js:800:25 at Function.module.exports.Emitter.simpleDispatch (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14) at Emitter.module.exports.Emitter.emit (/opt/atom/resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28) at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/opt/atom/resources/app.asar/src/command-registry.js:241:20) at CommandRegistry.handleCommandEvent (/opt/atom/resources/app.asar/src/command-registry.js:3:61) at CommandRegistry.module.exports.CommandRegistry.dispatch (/opt/atom/resources/app.asar/src/command-registry.js:160:19) at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/opt/atom/resources/app.asar/src/atom-environment.js:1013:28) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7)

amkarthik commented 8 years ago

Please help me to resolve this.

prettydiff commented 8 years ago

@Glavin001 You might have better insight on this one than I do.

Glavin001 commented 8 years ago

Something definitely did not get installed or built correctly.

TypeError: Beautifiers is not a function at Object. (/home/harmony-12/.atom/packages/atom-beautify/src/beautify.coffee:10:18)

Is related to https://github.com/Glavin001/atom-beautify/blob/master/src/beautify.coffee#L10 and that calls new Beautifiers() where Beautifiers is this class: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/index.coffee#L29

This should all work.

Please uninstall and reinstall Atom Beautify, and restart Atom. There must be something wrong with how it was installed.

Please run the following in your Terminal and let me know the results:

ls ~/.atom/packages/atom-beautify/src/**/*
amkarthik commented 8 years ago

@Glavin001 I tried removing and installing it shows the same error.

And the output of the above code is

/home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/autopep8.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/erb.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/beautifier.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/erlang.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/clang-format.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/fortran.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/coffee-fmt.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/gherkin.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/coffee-formatter.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/go.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/csscomb.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/handlebars.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/dfmt.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/haskell.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/elm-format.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/html.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/erl_tidy.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/index.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/gherkin.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/java.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/gofmt.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/javascript.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/htmlbeautifier.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/json.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/index.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/jsx.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/js-beautify.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/less.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/jscs.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/markdown.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/perltidy.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/marko.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/phpcbf.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/mustache.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/php-cs-fixer.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/objective-c.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/prettydiff.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/pawn.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/puppet-fix.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/perl.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/remark.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/php.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/rubocop.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/puppet.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/ruby-beautify.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/python.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/rustfmt.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/riotjs.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/sqlformat.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/ruby.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/stylish-haskell.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/rust.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/tidy-markdown.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/sass.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/typescript-formatter.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/scss.coffee /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/yapf.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/spacebars.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/apex.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/sql.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/arduino.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/svg.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/c.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/swig.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/coffeescript.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/tss.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/coldfusion.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/twig.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/cpp.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/typescript.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/c-sharp.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/vala.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/css.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/visualforce.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/csv.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/xml.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/d.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/xtemplate.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/ejs.coffee /home/harmony-12/.atom/packages/atom-beautify/src/views/loading-view.coffee /home/harmony-12/.atom/packages/atom-beautify/src/languages/elm.coffee /home/harmony-12/.atom/packages/atom-beautify/src/views/message-view.coffee

/home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/fortran-beautifier: emacs-fortran-formating-script.lisp index.coffee

/home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/uncrustify: cfg.coffee default.cfg index.coffee possible-options.json

Glavin001 commented 8 years ago

Could you take a look at /home/harmony-12/.atom/packages/atom-beautify/src/beautify.coffee around line 10. And also /home/harmony-12/.atom/packages/atom-beautify/src/beautifiers/index.coffee Maybe put those into a Gist for us to inspect.

amkarthik commented 8 years ago

beautify.coffee https://gist.github.com/0b322827a73e3b4822ad.git

index.coffee https://gist.github.com/9d0eb3b8783a8da4322c.git

Glavin001 commented 8 years ago

Both files look correct. I recommend that you attempt to debug the Atom editor on your own.

You could change file /home/harmony-12/.atom/packages/atom-beautify/src/beautify.coffee at line 10 to:

console.log(Beautifiers); # NEW LINE
beautifier = new Beautifiers() # Line 10

Then you can add a breakpoint and inspect Line 9,10,11 and see what variable Beautifiers value is. It should be a class in CoffeeScript. See http://coffeescript.org/#classes

You could uninstall Atom Beautify and then clone the Git repository for Atom Beautify and link it using apm link in the Atom Beautify clone directory, then restart Atom. Then you can edit the repo source code however you like. Feel free to submit a pull request if you can fix this. Thanks.

amkarthik commented 8 years ago

@Glavin001 atom-beautify@0.28.21 works well for me but the newer versions throws the above.

amkarthik commented 8 years ago

@Glavin001 New version atom-beautify@0.28.28 solved the issue. Thanks