klorenz / atom-table-editor

Easily edit and navigate markdown tables
MIT License
13 stars 3 forks source link

Uncaught TypeError: Cannot read property 'length' of null #3

Open hiroyuki-sato opened 8 years ago

hiroyuki-sato commented 8 years ago

Hello

I've tried atom-table-editor. It first time. I got the error Uncaught TypeError: Cannot read property 'length' of null

[Enter steps to reproduce below:]

  1. create table
  2. enter tab key in table cell (aaa).
| aaa | bbbbbbbbb    |
|:----|:-------------|
|  a  | aaaa |

Atom Version: 1.4.0 System: Mac OS X 10.11.2 Thrown From: table-editor package, v0.1.1

Stack Trace

Uncaught TypeError: Cannot read property 'length' of null

At /path/to/home/.atom/packages/table-editor/lib/table-processors.coffee:88

TypeError: Cannot read property 'length' of null
    at /path/to/home/.atom/packages/table-editor/lib/table-processors.coffee:88:42
    at Object.exports.parseString (/path/to/home/.atom/packages/table-editor/node_modules/asciiparse/index.js:112:3)
    at processMarkdownTable (/path/to/home/.atom/packages/table-editor/lib/table-processors.coffee:71:27)
    at /path/to/home/.atom/packages/table-editor/lib/table-processors.coffee:126:3
    at TableFormatter.module.exports.TableFormatter.getFormattedTableText (/path/to/home/.atom/packages/table-editor/lib/table-formatter.coffee:71:21)
    at TableFormatter.module.exports.TableFormatter.getSelectionRanges (/path/to/home/.atom/packages/table-editor/lib/table-formatter.coffee:109:17)
    at Object.module.exports.TableEditor.formatTable (/path/to/home/.atom/packages/table-editor/lib/table-editor.coffee:132:7)
    at atom-text-editor.subscriptions.add.atom.commands.add.table-editor:next-cell (/path/to/home/.atom/packages/table-editor/lib/table-editor.coffee:20:37)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260: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:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

  2x -3:34.2.0 core:select-down (atom-text-editor.editor.is-focused)
     -3:11 markdown-table-formatter:format (atom-text-editor.editor.is-focused)
     -3:06.7.0 core:move-left (atom-text-editor.editor.is-focused)
  2x -3:06.5.0 core:delete (atom-text-editor.editor.is-focused)
     -3:03.2.0 core:move-left (atom-text-editor.editor.is-focused)
     -3:03.0 core:delete (atom-text-editor.editor.is-focused)
     -3:01.4.0 core:move-right (atom-text-editor.editor.is-focused)
     -3:01.0 core:delete (atom-text-editor.editor.is-focused)
  2x -2:55.7.0 markdown-table-formatter:format (atom-text-editor.editor.is-focused)
     -2:39.4.0 core:delete (atom-text-editor.editor.is-focused.table-editor-active)
     -2:36.6.0 core:backspace (atom-text-editor.editor.is-focused.table-editor-active)
     -2:27.5.0 markdown-table-formatter:format (atom-text-editor.editor.is-focused)
     -1:15.7.0 application:new-file (atom-text-editor.editor.mini.is-focused)
  2x -0:13.9.0 core:move-left (atom-text-editor.editor.is-focused.table-editor-active)
     -0:13.5.0 core:delete (atom-text-editor.editor.is-focused.table-editor-active)
  2x -0:13 table-editor:next-cell (atom-text-editor.editor.is-focused.table-editor-active)

Config

{
  "core": {
    "audioBeep": false,
    "disabledPackages": [
      "recent-files",
      "markdown-pdf",
      "autocomplete-ruby",
      "linter-rubocop",
      "linter-ruby",
      "japanese-wrap",
      "tabs-to-spaces"
    ],
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
emacs-core-keys, v0.2.2
language-pgsql, v0.2.0
language-slim, v0.5.0
linter, v1.11.3
markdown-table-formatter, v2.7.2
open-recent, v4.0.1
table-editor, v0.1.1

# Dev
No dev packages
yihengqin commented 8 years ago

So is the issue solved now?

yihengqin commented 8 years ago

@hiroyuki-sato So is the issue solved now?

hiroyuki-sato commented 8 years ago

@lyhcc

Thank you for replying.

Latest environment.

Atom Version: 1.4.1 System: Mac OS X 10.11.2 Thrown From: table-editor package, v0.1.1

I don't get Uncaught TypeError: Cannot read property error now.

Move cell (Tab) work fine. But it can't add new row when I press enter key.

Example.

| c1 |   c2   |
|----|--------|
| aa | cceedd |
| cc | 日本語    |
| ee | ff     |
yihengqin commented 8 years ago

@hiroyuki-sato Thank you very much for you replying, because i confused for it almost a day. My environment: Atom Version: 1.4.1 System: Ubuntu 14.0.4 LTS Thrown From: table-editor package, v0.1.1 But the error is still have, although i had reinstall and ervery thing i can do... error May be i should reinstall the atom.

hiroyuki-sato commented 8 years ago

@lyhcc

I got same error when I use this table.

| aaa | bbbbbbbbb    |
|:----|:-------------|
|  a  | aaaa |

And this data is OK.

| c1 |   c2   |
|----|--------|
| aa | cceedd |
| cc | 日本語    |
| ee | ff     |

Please check this again.

yihengqin commented 8 years ago

@hiroyuki-sato

It still didn't work. Maybe I should give up. But thanks any way.

yihengqin commented 8 years ago

@hiroyuki-sato

It's magic. It seems OK. ok_eorr

And have two issues you said:

  1. Press enter key can't add a new row.
  2. This table will got the error.
  | aaa | bbbbbbbbb    |
  |:----|:-------------|
  |  a  | aaaa |

You are amazing!

taoeffect commented 8 years ago

I get this same error. No idea how to fix.

stefanpausch commented 7 years ago

Issue persist, even with 0.2.1 (got all problems regarding "cannot read property") Ubuntu Linux (latest version) 64bit Atom 1.10.0 (new installation, with only basic packages installed)

TypeError: Cannot read property 'length' of null at /home/spausch/.atom/packages/table-editor/lib/table-processors.coffee:105:42 at Object.exports.parseString (/home/spausch/.atom/packages/table-editor/node_modules/asciiparse/index.js:112:3) at processMarkdownTable (/home/spausch/.atom/packages/table-editor/lib/table-processors.coffee:85:27) at /home/spausch/.atom/packages/table-editor/lib/table-processors.coffee:152:3 at TableFormatter.module.exports.TableFormatter.getFormattedTableText (/home/spausch/.atom/packages/table-editor/lib/table-formatter.coffee:89:21) at TableFormatter.module.exports.TableFormatter.getSelectionRanges (/home/spausch/.atom/packages/table-editor/lib/table-formatter.coffee:152:17) at Object.module.exports.TableEditor.formatTable (/home/spausch/.atom/packages/table-editor/lib/table-editor.coffee:199:7) at atom-text-editor.subscriptions.add.atom.commands.add.table-editor:next-cell (/home/spausch/.atom/packages/table-editor/lib/table-editor.coffee:33:37) at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app.asar/src/command-registry.js:260:29) at /usr/share/atom/resources/app.asar/src/command-registry.js:3:61 at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16) at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22) at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app.asar/src/window-event-handler.js:98:36) at HTMLDocument. (/usr/share/atom/resources/app.asar/src/window-event-handler.js:3:61)