asciidoctor / atom-asciidoc-preview

βš› AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
141 stars 42 forks source link

Uncaught TypeError: Cannot read property 'parent' of null #184

Closed abradshaw closed 8 years ago

abradshaw commented 8 years ago

[Enter steps to reproduce below:]

  1. Update to the latest version
  2. Open the preview

Atom Version: 1.8.0 System: "Fedora release Thrown From: asciidoc-preview package, v2.4.1

Stack Trace

Uncaught TypeError: Cannot read property 'parent' of null

At /home/fab/abradsha/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:55

TypeError: Cannot read property 'parent' of null
    at Function.exports.update (/home/fab/abradsha/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:55:25)
    at module.exports (/home/fab/abradsha/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:17:11)
    at Function.exports.load (/home/fab/abradsha/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/static.js:19:14)
    at sanitize (/home/fab/abradsha/.atom/packages/asciidoc-preview/lib/renderer.coffee:54:12)
    at Task.callback (/home/fab/abradsha/.atom/packages/asciidoc-preview/lib/renderer.coffee:25:21)
    at /usr/lib64/atom/src/task.js:65:72
    at /usr/lib64/atom/src/task.js:126:25
    at Function.module.exports.Emitter.simpleDispatch (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/usr/lib64/atom/node_modules/event-kit/lib/emitter.js:125:28)
    at ChildProcess.<anonymous> (/usr/lib64/atom/src/task.js:78:34)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at handleMessage (internal/child_process.js:718:10)
    at Pipe.channel.onread (internal/child_process.js:444:11)

Commands

  2x -3:20.8.0 core:move-down (atom-text-editor.editor.power-mode.is-focused.mini)
     -3:20.3.0 core:move-right (atom-text-editor.editor.power-mode.is-focused.mini)
     -3:19.9.0 core:backspace (atom-text-editor.editor.power-mode.is-focused)
  2x -3:19.3.0 core:move-down (atom-text-editor.editor.power-mode.is-focused.mini)
     -3:18.7.0 core:move-right (atom-text-editor.editor.power-mode.is-focused)
     -3:18.4.0 core:backspace (atom-text-editor.editor.power-mode.is-focused.mini)
     -3:15.5.0 core:save (atom-text-editor.editor.power-mode.is-focused.mini)
  8x -2:47.6.0 core:move-up (atom-text-editor.editor.power-mode.is-focused)
 16x -2:46.1.0 core:move-right (atom-text-editor.editor.power-mode.is-focused)
  3x -2:44.3.0 core:move-left (atom-text-editor.editor.power-mode.is-focused)
     -2:42.2.0 core:save (atom-text-editor.editor.power-mode.is-focused)
     -1:14.3.0 core:backspace (atom-text-editor.editor.power-mode.is-focused.mini)
     -1:13.6.0 core:move-right (atom-text-editor.editor.power-mode.is-focused.mini)
     -0:26.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:24.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:01.1.0 asciidoc-preview:toggle (atom-text-editor.editor.power-mode.autocomplete-active.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  },
  "asciidoc-preview": {
    "tocType": "macro"
  }
}

Installed Packages

# User
activate-power-mode, v0.5.2
asciidoc-preview, v2.4.1
language-asciidoc, v1.5.1
minimap, v4.24.6

# Dev
No dev packages
ldez commented 8 years ago

@abradshaw have you the same behavior for all documents?

abradshaw commented 8 years ago

Yes, it does seem that way

ldez commented 8 years ago

Have you try the newest version? (2.4.2)

ParaplegicRacehorse commented 8 years ago

version 2.4.2. exhibits same behavior

[Enter steps to reproduce below:]

  1. update
  2. open preview (ctrl-shift-A)

Atom Version: 1.8.0 System: Ubuntu 14.04.4 Thrown From: asciidoc-preview package, v2.4.2

Stack Trace

Uncaught TypeError: Cannot read property 'parent' of null

At /home/natalie/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:55

TypeError: Cannot read property 'parent' of null
    at Function.exports.update (/home/natalie/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:55:25)
    at module.exports (/home/natalie/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/parse.js:17:11)
    at Function.exports.load (/home/natalie/.atom/packages/asciidoc-preview/node_modules/cheerio/lib/static.js:19:14)
    at sanitize (/home/natalie/.atom/packages/asciidoc-preview/lib/renderer.coffee:92:3)
    at Task.callback (/home/natalie/.atom/packages/asciidoc-preview/lib/renderer.coffee:28:10)
    at /opt/atom/resources/app.asar/src/task.js:65:72
    at /opt/atom/resources/app.asar/src/task.js:126: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 ChildProcess.<anonymous> (/opt/atom/resources/app.asar/src/task.js:78:34)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at handleMessage (internal/child_process.js:686:10)
    at Pipe.channel.onread (internal/child_process.js:440:11)

Commands

     -4:09.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  2x -4:07.0 core:move-down (atom-text-editor.editor.is-focused)
  7x -4:05.4.0 core:move-left (atom-text-editor.editor.is-focused)
 23x -4:03.3.0 core:select-left (atom-text-editor.editor.is-focused)
     -4:00.1.0 core:paste (atom-text-editor.editor.is-focused)
  2x -3:58.5.0 core:move-down (atom-text-editor.editor.is-focused)
     -3:57.6.0 core:move-left (atom-text-editor.editor.is-focused)
 23x -3:56.5.0 core:select-left (atom-text-editor.editor.is-focused)
     -3:48.9.0 tree-view:move (span.name.icon.icon-file-text)
     -3:47.3.0 core:copy (atom-text-editor.editor.mini.is-focused)
  2x -3:45.2.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -3:39.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -3:37.3.0 core:paste (atom-text-editor.editor.is-focused)
     -3:29.7.0 asciidoc-preview:toggle (atom-text-editor.editor.is-focused)
     -0:45.4.0 settings-view:open (div.asciidoc-preview.native-key-bindings)
     -0:01.4.0 asciidoc-preview:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "language-c",
      "language-go",
      "language-java",
      "language-javascript",
      "language-ruby",
      "language-ruby-on-rails",
      "language-sass",
      "language-sql",
      "language-clojure",
      "language-csharp",
      "language-make",
      "language-objective-c",
      "styleguide",
      "language-yaml",
      "language-toml",
      "linter-coffeescript",
      "language-gfm",
      "hyperclick-markdown",
      "language-markdown",
      "markdown-preview-opener",
      "markdown-scroll-sync",
      "markdown-sort-list",
      "markdown-toc",
      "markdown-url-extract",
      "markdown-writer",
      "tidy-markdown",
      "tool-bar-markdown-writer",
      "markdown-preview"
    ],
    "projectHome": "/home/natalie/Programming/",
    "themes": [
      "one-dark-ui",
      "pen-paper-coffee-syntax"
    ]
  },
  "asciidoc-preview": {
    "compatMode": true
  }
}

Installed Packages

# User
asciidoc-assistant, v0.2.0
asciidoc-image-helper, v1.0.0
asciidoc-preview, v2.4.2
autocomplete-asciidoc, v0.1.1
language-asciidoc, v1.5.1
linter, v1.11.11
linter-coffeelint, v1.1.2
linter-write-good, v0.6.1
markdown-writer, v2.3.4
package-settings, v1.1.0
package-switch, v0.5.0
pen-paper-coffee-syntax, v0.14.0
project-manager, v2.9.7
project-plus, v0.9.0
recent-projects, v0.11.2
tool-bar, v0.4.0
tool-bar-atom, v1.5.0

# Dev
No dev packages
ldez commented 8 years ago

@ParaplegicRacehorse can you close and reopen Atom?

The stackstrace that you provided come from 2.4.1. I suppose you have update and test without restart, I am right?

ParaplegicRacehorse commented 8 years ago

That is correct. No restart after update. Everything works well after restart; and continues to work well after upgrade to 2.5.1.

ldez commented 8 years ago

@ParaplegicRacehorse Good news! :smile:

@abradshaw can you retry with the latest version and restart after update?

abradshaw commented 8 years ago

Ok, for some reason Im failing to update to 2.5.1 - I wonder if its because Im using the RPM packaged version from UnitedRPMs

When I click on update I get the red box

/usr/lib64/atom/node_modules/settings-view/lib/package-card.js:709 Hide Stack Trace <#> TypeError: Cannot read property 'substr' of null at /usr/lib64/atom/node_modules/settings-view/lib/package-card.js:709:80 at /usr/lib64/atom/node_modules/settings-view/lib/package-manager.js:376:51 at /usr/lib64/atom/node_modules/settings-view/lib/package-manager.js:403:20 at exit (/usr/lib64/atom/node_modules/settings-view/lib/package-manager.js:73:16) at triggerExitCallback (/usr/lib64/atom/src/buffered-process.js:215:47) at /usr/lib64/atom/src/buffered-process.js:229:18 at Socket. (/usr/lib64/atom/src/buffered-process.js:100:18) at emitOne (events.js:95:20) at Socket.emit (events.js:182:7) at Pipe._onclose (net.js:477:12)

On 19 June 2016 at 18:05, Ludovic Fernandez notifications@github.com wrote:

@ParaplegicRacehorse https://github.com/ParaplegicRacehorse Good news! πŸ˜„

@abradshaw https://github.com/abradshaw can you retry with the latest version and restart after update?

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/atom-asciidoc-preview/issues/184#issuecomment-227005204, or mute the thread https://github.com/notifications/unsubscribe/AAYqjMGmAVsl54IrgHkqzkyOwn5nUsS1ks5qNWjggaJpZM4I3mcR .

ldez commented 8 years ago

@abradshaw you have clearly a bug with your Atom installation.

Uninstall and install from the official Atom RPM https://atom.io/download/rpm

abradshaw commented 8 years ago

Yup, that did the trick, installed the rpm from the link you sent, updated to 2.5.1, closed and re-opened, seems to be working fine now.

Many many thanks !

On 19 June 2016 at 18:14, Ludovic Fernandez notifications@github.com wrote:

@abradshaw https://github.com/abradshaw you have clearly a bug with your Atom installation.

Uninstall and install from the official Atom RPM https://atom.io/download/rpm

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/atom-asciidoc-preview/issues/184#issuecomment-227005661, or mute the thread https://github.com/notifications/unsubscribe/AAYqjLrDsY2CbCifN4yyHaQwrwv-7EgRks5qNWrbgaJpZM4I3mcR .

ldez commented 8 years ago

very happy, to have helped you :smile: