izuzak / atom-pdf-view

Support for viewing PDF files in Atom.
https://atom.io/packages/pdf-view
MIT License
108 stars 30 forks source link

Uncaught TypeError: Cannot read property 'numPages' of undefined #83

Closed jvanburen closed 9 years ago

jvanburen commented 9 years ago

Steps to reproduce:

  1. Use cmd-+

Atom Version: 1.0.19 System: Mac OS X 10.11 Thrown From: pdf-view package, v0.28.0

Stack Trace

Uncaught TypeError: Cannot read property 'numPages' of undefined

At /Users/jacob/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:161

TypeError: Cannot read property 'numPages' of undefined
  at PdfEditorView.module.exports.PdfEditorView.renderPdf (/Users/jacob/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:161:26)
  at PdfEditorView.module.exports.PdfEditorView.adjustSize (/Users/jacob/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:229:6)
  at PdfEditorView.module.exports.PdfEditorView.zoomIn (/Users/jacob/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:195:6)
  at atom-workspace.atom.commands.add.pdf-view:zoom-in (/Users/jacob/.atom/packages/pdf-view/lib/pdf-editor-view.coffee:71:31)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:245:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:524:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:347:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:184:20)

Commands

  2x -4:09.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -4:07.8.0 core:move-right (atom-text-editor.editor.is-focused)
  5x -4:07.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:49.5.0 snippets:next-tab-stop (atom-text-editor.editor.is-focused)
     -3:49.5.0 snippets:expand (atom-text-editor.editor.is-focused)
     -3:49.5.0 editor:indent (atom-text-editor.editor.is-focused)
     -3:48.9.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:44.7.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
     -3:37.2.0 core:move-left (atom-text-editor.editor.is-focused)
     -3:36.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -3:35.3.0 core:save (atom-text-editor.editor.is-focused)
     -3:26 latex:build (atom-text-editor.editor.is-focused)
     -0:44.5.0 core:save (atom-text-editor.editor.is-focused)
     -0:35.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:35.3.0 core:save (atom-text-editor.editor.is-focused)
  3x -0:01.1.0 pdf-view:zoom-in (div.pdf-view)

Config

{
  "core": {
    "disabledPackages": [
      "metrics",
      "language-ruby-on-rails",
      "language-sass",
      "language-toml",
      "language-yaml",
      "language-xml",
      "language-clojure",
      "language-coffee-script",
      "language-csharp",
      "language-go",
      "language-mustache",
      "language-objective-c",
      "language-php",
      "line-ending-selector",
      "bookmarks"
    ],
    "themes": [
      "one-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  }
}

Installed Packages

# User
language-latex, v0.6.1
latex, v0.25.1
pdf-view, v0.28.0

# Dev
No dev packages
izuzak commented 9 years ago

Thanks for the report, @jvanburen. I'm having trouble reproducing this problem, so I'm wondering if you could share a bit more details. Does this happen every time you press cmd-+ or randomly? Does this happen for every PDF file or only some (if only for some, can you share a link to that PDF)? Does this happen if you just open a PDF and don't use the latex package to generate PDFs? Did this problem start happening recently (i.e. with a recent update of the pdf-view package)?

jvanburen commented 9 years ago

It's a new issue (updated both OS X and atom-pdf-view). It occurs every time I press cmd-+ on PDFs generated by pdflatex. I can test it with other PDFs and get more info tomorrow.

— Jacob Van Buren

On Sun, Oct 4, 2015 at 2:06 AM, Ivan Žužak notifications@github.com wrote:

Thanks for the report, @jvanburen. I'm having trouble reproducing this problem, so I'm wondering if you could share a bit more details. Does this happen every time you press ctrl-+ or randomly? Does this happen for every PDF file or only some (if only for some, can you share a link to that PDF)? Does this happen if you just open a PDF and don't use the latex package to generate PDFs? Did this problem start happening recently (i.e. with a recent update of the pdf-view package)?

Reply to this email directly or view it on GitHub: https://github.com/izuzak/atom-pdf-view/issues/83#issuecomment-145320582

izuzak commented 9 years ago

Thanks for the details. :bow: I'm still having trouble reproducing this (by just opening a PDF and pressing cmd-+), but I just pushed a new version which should hopefully prevent this from happening. Give it a try and let me know if you can still trigger that error.

jvanburen commented 9 years ago

Checking back in, it seems the latest update fixed the issue, thanks!