iocast / atom-esdoc

MIT License
0 stars 0 forks source link

Uncaught TypeError: SWITCHES[node.declaration.type] is not a function #4

Closed chikamichi closed 6 years ago

chikamichi commented 6 years ago

Hi,

With a fresh install, upon writing /** and hitting TAB:

Atom: 1.24.0 x64 Electron: 1.6.16 OS: linux 4.15.3-53.current Thrown From: esdoc package 0.2.1

Stack Trace

Uncaught TypeError: SWITCHES[node.declaration.type] is not a function

At /home/jd/.atom/packages/esdoc/lib/parser.js:123

TypeError: SWITCHES[node.declaration.type] is not a function
    at Object.ExportNamedDeclaration (/packages/esdoc/lib/parser.js:123:39)
    at parseNode (/packages/esdoc/lib/parser.js:202:71)
    at enter (/packages/esdoc/lib/parser.js:216:27)
    at NodePath._call (/packages/esdoc/node_modules/babel-traverse/lib/path/context.js:76:18)
    at NodePath.call (/packages/esdoc/node_modules/babel-traverse/lib/path/context.js:44:14)
    at NodePath.visit (/packages/esdoc/node_modules/babel-traverse/lib/path/context.js:105:12)
    at TraversalContext.visitQueue (/packages/esdoc/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitMultiple (/packages/esdoc/node_modules/babel-traverse/lib/context.js:103:17)
    at TraversalContext.visit (/packages/esdoc/node_modules/babel-traverse/lib/context.js:190:19)
    at Function.traverse.node (/packages/esdoc/node_modules/babel-traverse/lib/index.js:114:17)
    at NodePath.visit (/packages/esdoc/node_modules/babel-traverse/lib/path/context.js:115:19)
    at TraversalContext.visitQueue (/packages/esdoc/node_modules/babel-traverse/lib/context.js:150:16)
    at TraversalContext.visitSingle (/packages/esdoc/node_modules/babel-traverse/lib/context.js:108:19)
    at TraversalContext.visit (/packages/esdoc/node_modules/babel-traverse/lib/context.js:192:19)
    at Function.traverse.node (/packages/esdoc/node_modules/babel-traverse/lib/index.js:114:17)
    at traverse (/packages/esdoc/node_modules/babel-traverse/lib/index.js:79:12)
    at getNode (/packages/esdoc/lib/parser.js:213:3)
    at parse (/packages/esdoc/lib/parser.js:236:14)
    at comment (/packages/esdoc/lib/esdocer.js:9:14)
    at Object.generate (/packages/esdoc/lib/esdoc.js:45:9)
    at Object.parseEnter (/packages/esdoc/lib/esdoc.js:74:16)
    at HTMLElement.esdocParseEnter (/packages/esdoc/lib/esdoc.js:24:42)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:388:36)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/src/window-event-handler.js:108:40)

Commands

     -1:02.1.0 intentions:highlight (input.hidden-input)
     -1:02.1.0 pane:show-previous-item (input.hidden-input)
     -0:58.9.0 vim-mode-plus:move-right (input.hidden-input)
     -0:58.8.0 vim-mode-plus:activate-insert-mode (input.hidden-input)
     -0:58.5.0 core:move-right (input.hidden-input)
     -0:58.4.0 intentions:highlight (input.hidden-input)
  2x -0:58.3.0 editor:select-to-beginning-of-word (input.hidden-input)
     -0:57.7.0 core:delete (input.hidden-input)
     -0:57.4.0 intentions:highlight (input.hidden-input)
     -0:57.3.0 editor:move-to-end-of-word (input.hidden-input)
     -0:57 core:delete (input.hidden-input)
     -0:56.7.0 vim-mode-plus:activate-normal-mode (input.hidden-input)
     -0:54.9.0 intentions:highlight (input.hidden-input)
     -0:54.8.0 core:save (input.hidden-input)
     -0:36.7.0 vim-mode-plus:insert-below-with-newline (input.hidden-input)
     -0:34.8.0 esdoc:parse-enter (input.hidden-input)

Non-Core Packages

ansible-vault 0.6.9 
atom-beautify 0.30.9 
atom-ide-ui 0.8.1 
atom-ternjs 0.18.3 
atom-tsd 0.9.0 
atom-typescript 12.1.2 
busy-signal 1.4.3 
clipboard-plus 0.5.1 
dockerletion 0.2.0 
esdoc 0.2.1 
file-icons 2.1.16 
fonts 3.0.3 
highlight-column 0.5.4 
ide-css 0.2.0 
ide-html 0.4.1 
ide-json 0.2.0 
ide-php 0.7.5 
ide-python 0.8.0 
ide-standardjs 0.0.1 
intentions 1.1.5 
language-ansible 0.2.2 
language-docker 1.1.8 
language-elm 1.5.0 
language-gherkin 1.0.4 
language-haml 0.25.2 
language-rspec 0.7.0 
language-tmux 0.4.0 
linter 2.2.0 
linter-ansible-linting 1.3.1 
linter-codeclimate 0.2.5 
linter-docker 0.3.0 
linter-elm-make 0.28.1 
linter-eslint 8.4.1 
linter-ui-default 1.6.10 
markdown-pdf 2.1.0 
minimap 4.29.7 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-linter 2.1.3 
minimap-pigments 0.2.2 
minimap-selection 4.5.0 
pigments 0.40.2 
rails-i18n-autocomplete 0.4.0 
script 3.17.3 
tabs-to-spaces 1.0.3 
todo-show 2.1.0 
trailing-spaces 0.4.0 
vim-mode-plus 1.28.0 
yaml-path-copy 2.1.6 
iocast commented 6 years ago

please attach a example

chikamichi commented 6 years ago

Hi @iocast, what do you mean by example?

iocast commented 6 years ago

@chikamichi: I assume that you have a function or similar and then wanted to generate the documentation. To fix it, it is important to have the signature of the code (function). something like

async function test(param1, param2) {
    throw new Error("test");
}

I just need an example to provoke the exception.