atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Uncaught TypeError: Cannot read property 'slice' of null #120

Closed snthibaud closed 8 years ago

snthibaud commented 8 years ago

This error popped up when starting atom

Atom Version: 1.5.3 System: Debian GNU/Linux Thrown From: haskell-ghc-mod package, v1.9.4

Stack Trace

Uncaught TypeError: Cannot read property 'slice' of null

At /home/snthibaud/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:64

TypeError: Cannot read property 'slice' of null
    at /home/snthibaud/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:64:13
    at ChildProcess.exithandler (child_process.js:206:7)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:817:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

Commands

Config

{
  "core": {
    "disabledPackages": [
      "spell-check"
    ]
  }
}

Installed Packages

# User
haskell-ghc-mod, v1.9.4
ide-haskell, v1.5.2
language-haskell, v1.7.1

# Dev
No dev packages
lierdakil commented 8 years ago

What version of ghc-mod do you use?

snthibaud commented 8 years ago

4.1.2-2, the default in Debian Jessie

lierdakil commented 8 years ago

Could you run ghc-mod version and post its output verbatim?

snthibaud commented 8 years ago

Thanks for the quick support! The output is:

ghc-mod version 4.1.2 compiled by GHC 7.6.3

lierdakil commented 8 years ago

Bear in mind though, that ghc-mod v4.* is deprecated, so you'd be better off updating ghc-mod installation (e.g. with cabal install). If not an option, I'll try to accommodate within reason, but expect some bugs.

lierdakil commented 8 years ago

Okay, so 1.9.5 should fix this particular issue. But I expect that you will run into more. Unfortunately, I can't easily test with 4.x, so I will have to rely on user reports.

snthibaud commented 8 years ago

Ok... I'm trying to install it with stack... I'm not sure how to install something system-wide with stack, though...

snthibaud commented 8 years ago

Ok, thanks for the quick support! I'll try updating the package, then!

lierdakil commented 8 years ago

You don't really have to install anything system-wide, unless you need multiple users to have the same work environment. Stack will install packages into home directory under $HOME/.local/bin by default, at which point those could be easily run from there.

snthibaud commented 8 years ago

Ok! I did that and it worked. I don't get the error when starting anymore (even with 1.9.4). the strange thing is that ghc-mod version still indicates 4.1.2, but I guess atom finds the other one?

snthibaud commented 8 years ago

Thank you again!

lierdakil commented 8 years ago

What Atom finds is entirely dependent on environment, or more precisely PATH environment variable. You can configure haskell-ghc-mod package to find it regardless, as outlined in ide-haskell README and here.