seongjaelee / nvatom

nvatom (unpublished from atom.io)
MIT License
75 stars 14 forks source link

error #52

Closed rsshel closed 8 years ago

rsshel commented 8 years ago

[Enter steps to reproduce below:]

  1. ... opened nvatom as usual
  2. ... typed a few letters, hit return; threw error:

Atom Version: 1.8.0 System: Linux Mint Thrown From: nvatom package, v0.10.0

Stack Trace

Uncaught TypeError: Cannot read property 'name' of undefined

At /opt/atom/resources/app.asar/src/package-manager.js:619

TypeError: Cannot read property 'name' of undefined
    at PackageManager.module.exports.PackageManager.deactivatePackage (/opt/atom/resources/app.asar/src/package-manager.js:619:36)
    at save (/home/robert/.atom/packages/nvatom/lib/notational-velocity-view.coffee:108:25)
    at later (/opt/atom/resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:724:25)

Commands

     -0:09.7.0 nvatom:toggle (ul.list-inline.tab-bar.inset-panel)
  2x -0:02.4.0 editor:newline (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "language-c",
      "language-clojure",
      "language-coffee-script",
      "language-csharp",
      "language-gfm",
      "language-git",
      "language-go",
      "language-java",
      "language-javascript",
      "language-json",
      "language-less",
      "language-make",
      "language-mustache",
      "language-objective-c",
      "language-perl",
      "language-php",
      "language-property-list",
      "language-ruby",
      "language-ruby-on-rails",
      "language-source",
      "language-toml",
      "package-generator",
      "symbols-view",
      "styleguide",
      "open-on-github",
      "autocomplete-css",
      "autocomplete-atom-api",
      "autocomplete-html",
      "deprecation-cop",
      "dev-live-reload",
      "encoding-selector",
      "language-css",
      "language-sql",
      "language-todo",
      "language-xml",
      "markdown-preview",
      "wrap-guide",
      "whitespace",
      "welcome",
      "autocomplete-python",
      "pandoc-convert",
      "project-manager",
      "script"
    ],
    "ignoredNames": [
      ".git",
      ".hg",
      ".svn",
      ".DS_Store",
      "._*",
      "Thumbs.db",
      ".localized",
      ".sync",
      "prefs.db",
      ".dropbox.cache",
      ".dropbox"
    ],
    "openEmptyEditorOnStart": false,
    "themes": [
      "one-light-ui",
      "base16-tomorrow-light-theme"
    ]
  },
  "nvatom": {
    "directory": "/home/TextNotes",
    "extensions": [
      ".txt",
      ".md"
    ]
  }
}

Installed Packages

# User
language-pfm, v0.82.0
markdown-preview-plus, v2.4.0
minimap, v4.24.6
nvatom, v0.10.0

# Dev
No dev packages
hbuschme commented 8 years ago

I've got exactly the same problem, also with version 1.8.0. Happens when I close a file.

Just tried nvatom for the first time though.

rsshel commented 8 years ago

It is a very handy package. I use it on my Mac now instead of NValt. It still works on Mac, incidentally, with no problems after the update. Just a Linux problem.

Sent from my iPhone

On Jun 16, 2016, at 12:33 PM, Hendrik Buschmeier notifications@github.com wrote:

I've got exactly the same problem, also with version 1.8.0. Happens when I close a file.

Just tried nvatom for the first time though.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

seongjaelee commented 8 years ago

/opt/atom/resources/app.asar/src/package-manager.js Hmm... I don't know what that file is. I'm using OSX... I'll find a linux machine tomorrow and play with it.

hbuschme commented 8 years ago

I'm using OS X as well (10.10 Yosemite):

/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:619

TypeError: Cannot read property 'name' of undefined
    at PackageManager.module.exports.PackageManager.deactivatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:619:36)
    at save (/Users/hendrik/.atom/packages/nvatom/lib/notational-velocity-view.coffee:108:25)
    at later (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/underscore-plus/node_modules/underscore/underscore.js:724:25)

I have to correct myself: The error already happens when I save a file.

hbuschme commented 8 years ago

The problem is that nvatom tries to deactivate the package whitespace before saving (trailing whitespace is meaningful in Markdown) and that I had disabled it globally in Atom settings. Deactivating a package that is disabled, causes the function deactivatePackage in PackageManager to throw an error. Enabling the whitespace package globally fixed the problem.

@seongjaelee I am not familiar with CoffeeScript programming and currently do not have the time to look into this in more detail, but I think the problem should be easily fixable in nvatom by checking whether the package that will be deactivated is actually available (i.e. installed and enabled). In general this would better be addressed in the package manager itself though.

@rsshel Could you check, whether this fixes your problem as well?

rsshel commented 8 years ago

Sorry for the slow reply. Yes, that did it for me! I also had whitespace disabled. Thanks!

Robert Shelton

On Thu, Jun 23, 2016 at 4:30 AM, Hendrik Buschmeier < notifications@github.com> wrote:

The problem is that nvatom tries to deactivate the package whitespace https://github.com/atom/whitespace before saving (trailing whitespace is meaningful in Markdown) and that I had disabled it globally in Atom settings. Deactivating a package that is disabled, causes the function deactivatePackage in PackageManager to throw an error. Enabling the whitespace package globally fixed the problem.

@seongjaelee https://github.com/seongjaelee I am not familiar with CoffeeScript programming and currently do not have the time to look into this in more detail, but I think the problem should be easily fixable in nvatom by checking whether the package that will be deactivated is actually available (i.e. installed and enabled). In general this would better be addressed in the package manager itself though.

@rsshel https://github.com/rsshel Could you check, whether this fixes your problem as well?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/seongjaelee/nvatom/issues/52#issuecomment-227983798, or mute the thread https://github.com/notifications/unsubscribe/ATCcU5_MygAj7R0peDZ8r2OFflUP5x7Dks5qOkQigaJpZM4I25OD .

seongjaelee commented 8 years ago

I got it; the fix will be there soon. Thanks!

seongjaelee commented 8 years ago

Just for the future reference to myself, package-manager.js is the compiled version of atom's package-manager.coffee.

seongjaelee commented 8 years ago

Thanks a lot Robert and Hendrik tracking down this problem so far. =D

hbuschme commented 8 years ago

Thanks for fixing it so quickly.