atom-haskell / ide-haskell-hasktags

Hasktags-powered replacement for symbols-view on Haskell projects
https://atom.io/packages/ide-haskell-hasktags
MIT License
6 stars 2 forks source link

Uncaught TypeError: Cannot read property 'setEncoding' of undefined #10

Open dniku opened 7 years ago

dniku commented 7 years ago

Steps to reproduce: no idea. I had a somewhat broken compilation cache (see https://github.com/atom-haskell/haskell-ghc-mod/issues/212) and I was issuing commands like stack clean. After I switched back to the Atom window, I had this error.

Atom: 1.16.0 x64 Electron: 1.4.15 OS: "Manjaro Linux" Thrown From: ide-haskell-hasktags package 0.0.10

Stack Trace

Uncaught TypeError: Cannot read property 'setEncoding' of undefined

At /usr/lib/atom/src/buffered-process.js:184

TypeError: Cannot read property 'setEncoding' of undefined
    at BufferedProcess.bufferStream (/usr/lib/atom/src/buffered-process.js:184:13)
    at BufferedProcess.handleEvents (/usr/lib/atom/src/buffered-process.js:333:14)
    at BufferedProcess.start (/usr/lib/atom/src/buffered-process.js:113:12)
    at new BufferedProcess (/usr/lib/atom/src/buffered-process.js:96:12)
    at Tags.module.exports.Tags.update (/packages/ide-haskell-hasktags/lib/tags.coffee:64:9)
    at /packages/ide-haskell-hasktags/lib/tags.coffee:47:8)
    at emitTwo (events.js:106:13)
    at FSWatcher.emit (events.js:191:7)
    at /packages/ide-haskell-hasktags/node_modules/chokidar/index.js:191:15)
    at FSWatcher._emit (/packages/ide-haskell-hasktags/node_modules/chokidar/index.js:233:5)
    at FSWatcher.NodeFsHandler._handleFile (/packages/ide-haskell-hasktags/node_modules/chokidar/lib/nodefs-handler.js:275:10)
    at /packages/ide-haskell-hasktags/node_modules/chokidar/lib/nodefs-handler.js:473:21)
    at FSReqWrap.oncomplete (fs.js:123:15)

Commands

Non-Core Packages

atom-fuzzy-grep 0.16.0 
autocomplete-haskell 0.7.2 
custom-title 1.0.1 
haskell-ghc-mod 1.19.9 
ide-haskell 1.9.6 
ide-haskell-hasktags 0.0.10 
language-haskell 1.12.1 
minimap 4.28.2 
lierdakil commented 7 years ago

Uh. My response would be pretty much the same as in https://github.com/atom-haskell/haskell-ghc-mod/issues/211... Frankly, I would suspect faulty RAM, but that's baseless conjecture of course. Also might be a bug in Atom, but don't quote me on that.

I will point out that the error is thrown from the depths of Atom internals, so not much I could possibly do, even if I knew what.

cblp commented 6 years ago

Just installed ide-haskell-hasktags, and having the same. Can the missing hasktags be the cause?

lierdakil commented 6 years ago

@cblp, generally, you would expect something like this from missing hasktags: image

Since the code base changed a lot since this was last reported, I would appreciate it if you'd provide a complete report. There's a clipboard icon on the big scary error message that should copy the Markdown-formatted report into the clipboard: atom-report

cblp commented 6 years ago

[Enter steps to reproduce:]

  1. Edit stack.yaml
  2. Very big extra-dep library takes too long to build

Atom: 1.24.0 x64 Electron: 1.6.16 OS: Ubuntu 17.10 Thrown From: ide-haskell-hasktags package 0.0.13

Stack Trace

Uncaught TypeError: Cannot read property 'setEncoding' of undefined

At /usr/share/atom/resources/app/src/buffered-process.js:200

TypeError: Cannot read property 'setEncoding' of undefined
    at BufferedNodeProcess.bufferStream (/usr/share/atom/resources/app/src/buffered-process.js:200:19)
    at BufferedNodeProcess.handleEvents (/usr/share/atom/resources/app/src/buffered-process.js:349:20)
    at BufferedNodeProcess.start (/usr/share/atom/resources/app/src/buffered-process.js:129:18)
    at BufferedNodeProcess.BufferedProcess (/usr/share/atom/resources/app/src/buffered-process.js:112:18)
    at /app.asar/src/buffered-node-process.js:74:85)
    at Tags.update (/packages/ide-haskell-hasktags/lib/tags.js:75:9)
    at Tags.filesChanged (/packages/ide-haskell-hasktags/lib/tags.js:18:30)
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at didChangeCallback (/usr/share/atom/resources/app/src/project.js:357:28)
    at PathWatcher.onNativeEvents (/usr/share/atom/resources/app/src/path-watcher.js:671:15)
    at /usr/share/atom/resources/app/src/path-watcher.js:567:31
    at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at NativeWatcher.onEvents (/usr/share/atom/resources/app/src/path-watcher.js:448:26)
    at handler (/usr/share/atom/resources/app/src/path-watcher.js:177:15)

Commands

     -2:16.6.0 autocomplete-plus:confirm (input.hidden-input)
     -2:16.5.0 intentions:highlight (input.hidden-input)
     -2:16.4.0 core:save (input.hidden-input)
  7x -2:13 core:move-down (input.hidden-input)
     -2:11.9.0 editor:move-to-end-of-screen-line (input.hidden-input)
 12x -2:11.8.0 core:move-left (input.hidden-input)
     -2:08.6.0 intentions:highlight (input.hidden-input)
     -2:08.5.0 core:save (input.hidden-input)
     -0:50.6.0 intentions:highlight (input.hidden-input)
  3x -0:50.5.0 pane:show-next-item (input.hidden-input)
 20x -0:49.2.0 core:move-down (input.hidden-input)
 14x -0:47.9.0 core:move-right (input.hidden-input)
     -0:46.8.0 intentions:highlight (input.hidden-input)
     -0:46.7.0 find-and-replace:select-next (input.hidden-input)
     -0:46 core:paste (input.hidden-input)
     -0:45.7.0 core:save (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.0 
autocomplete-haskell 1.0.1 
busy-signal 1.4.3 
date 2.1.0 
haskell-ghc-mod 2.2.3 
haskell-scry 1.0.7 
highlight-selected 0.13.1 
ide-haskell 2.3.0 
ide-haskell-cabal 2.1.2 
ide-haskell-hasktags 0.0.13 
ide-haskell-hoogle 0.1.2 
ide-haskell-repl 0.7.15 
intentions 1.1.5 
language-haskell 1.17.3 
linter 2.2.0 
linter-ui-default 1.7.0 
semanticolor 3.6.0 
sort-lines 0.18.0 
tab-smart-sort 0.3.0 
teletype 0.9.0 
lierdakil commented 6 years ago

@cblp, thanks.

It looks like process dies before Atom sets up event handlers... Which I honestly have no explanation for.

So... I've released v0.0.14, which uses node's child_process directly without Atom's wrappers. Let's see if that helps.