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 Error: ENOENT: no such file or directory, stat '' #95

Closed hnn closed 8 years ago

hnn commented 8 years ago

[Enter steps to reproduce below:]

This occurs on showing the tooltip for my .hs files.

Atom Version: 1.3.3 System: Mac OS X 10.11.2 Thrown From: haskell-ghc-mod package, v1.6.0

Stack Trace

Uncaught Error: ENOENT: no such file or directory, stat ''

At ATOM_SHELL_ASAR.js:0

Error: ENOENT: no such file or directory, stat ''
    at Error (native)
    at fs.statSync (fs.js:854:18)
    at Object.fs.statSync (ATOM_SHELL_ASAR.js:225:16)
    at Object.module.exports.Util.isDirectory (/Users/hn/.atom/packages/haskell-ghc-mod/node_modules/atom-haskell-utils/lib/util.js:22:21)
    at GhcModiProcessReal.module.exports.GhcModiProcessReal.getRootDir (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process-real.coffee:31:23)
    at GhcModiProcess.module.exports.GhcModiProcess.getRootDir (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:308:5)
    at GhcModiProcess.module.exports.GhcModiProcess.queueCmd (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:144:21)
    at GhcModiProcess.queueCmd (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:1:1)
    at GhcModiProcess.module.exports.GhcModiProcess.getInfoInBuffer (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:216:6)
    at GhcModiProcess.getInfoInBuffer (/Users/hn/.atom/packages/haskell-ghc-mod/lib/ghc-mod/ghc-modi-process.coffee:1:1)
    at /Users/hn/.atom/packages/haskell-ghc-mod/lib/haskell-ghc-mod.coffee:114:16
    at /Users/hn/.atom/packages/haskell-ghc-mod/lib/haskell-ghc-mod.coffee:206:11
    at _this.showTooltip.tooltip (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:115:30)
    at /Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:131:7
    at UPIInstance.withEventRange (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:208:5)
    at UPIInstance.showTooltip (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:130:6)
    at /Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:111:8
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/hn/.atom/packages/ide-haskell/lib/plugin-manager.coffee:73:18
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at EditorControl.shouldShowTooltip (/Users/hn/.atom/packages/ide-haskell/lib/editor-control.coffee:129:16)
    at /Users/hn/.atom/packages/ide-haskell/lib/editor-control.coffee:53:42

Commands

  5x -1:12.7.0 core:close (atom-text-editor.editor.is-focused)
     -0:11 settings-view:open (atom-text-editor.editor.is-focused)
     -0:07.0 core:close (div.package-detail.panels-item)

Config

{
  "core": {
    "disabledPackages": [
      "git-history",
      "whitespace",
      "build",
      "haskell-pointfree",
      "ide-haskell-repl",
      "ide-haskell-hasktags",
      "ide-haskell-cabal"
    ]
  },
  "haskell-ghc-mod": {
    "additionalPathDirectories": [
      "/Applications/ghc-7.10.2.app/Contents/bin",
      "/Users/hn/.cabal/bin"
    ],
    "enableGhcModi": false,
    "onMouseHoverShow": "Info",
    "onSaveLint": false
  }
}

Installed Packages

# User
autocomplete-haskell, v0.6.2
file-icons, v1.6.13
haskell-ghc-mod, v1.6.0
ide-haskell, v1.3.9
language-haskell, v1.5.2
linter, v1.11.3
minimap, v4.19.0

# Dev
No dev packages
lierdakil commented 8 years ago

That's weird. Try v1.6.1, it will hopefully at least produce a more meaningful error message.

Note that v1.6.0 tries hard to play nicer with stack. So if you're using stack, you might need to reconfigure haskell-ghc-mod to remove some hacks you were using. disregard that, judging from config, you don't seem to be using stack.

hnn commented 8 years ago

v1.6.1 results in the same error (even the error message is the same).

Stack is configured for this project, but it is not used locally (it is only used on the build server). I have not configured haskell-ghc-mod in any way to work with stack, so I am not aware of any hacks I could remove. Switching the "Stack Sandbox" flag on or off also does not seem to make a difference.

lierdakil commented 8 years ago

Either I'm misreading stack trace, or something has gone horribly wrong. If v1.6.3 does the same thing (which shouldn't be technically possible), try uninstalling haskell-ghc-mod, restarting Atom, and then reinstalling it again.

hnn commented 8 years ago

Well, there still is an error, but at least now the message is more meaningful:

Atom Version: 1.3.3 System: Mac OS X 10.11.2 Thrown From: haskell-ghc-mod package, v1.6.3

Stack Trace

Uncaught TypeError: Cannot read property 'getInfoInBuffer' of null

At /Users/hn/.atom/packages/haskell-ghc-mod/lib/haskell-ghc-mod.coffee:122

TypeError: Cannot read property 'getInfoInBuffer' of null
    at /Users/hn/.atom/packages/haskell-ghc-mod/lib/haskell-ghc-mod.coffee:122:15
    at /Users/hn/.atom/packages/haskell-ghc-mod/lib/haskell-ghc-mod.coffee:214:11
    at _this.showTooltip.tooltip (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:115:30)
    at /Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:131:7
    at UPIInstance.withEventRange (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:208:5)
    at UPIInstance.showTooltip (/Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:130:6)
    at /Users/hn/.atom/packages/ide-haskell/lib/upi.coffee:111:8
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/hn/.atom/packages/ide-haskell/lib/plugin-manager.coffee:73:18
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at EditorControl.shouldShowTooltip (/Users/hn/.atom/packages/ide-haskell/lib/editor-control.coffee:129:16)
    at /Users/hn/.atom/packages/ide-haskell/lib/editor-control.coffee:53:42

Commands

     -0:32.7.0 core:copy (atom-text-editor.editor.mini.is-focused)
     -0:32.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:28.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "git-history",
      "whitespace",
      "build",
      "haskell-pointfree",
      "ide-haskell-repl",
      "ide-haskell-hasktags"
    ]
  },
  "haskell-ghc-mod": {
    "additionalPathDirectories": [
      "/Applications/ghc-7.10.2.app/Contents/bin",
      "/Users/hn/.cabal/bin"
    ],
    "enableGhcModi": false,
    "onMouseHoverShow": "Info",
    "onSaveLint": false,
    "debug": true
  }
}

Installed Packages

# User
autocomplete-haskell, v0.6.2
file-icons, v1.6.13
ide-haskell, v1.3.9
ide-haskell-cabal, v1.0.0
language-haskell, v1.5.2
linter, v1.11.3
minimap, v4.19.0

# Dev
No dev packages
lierdakil commented 8 years ago

Nope. Even more meaningless. This last error should basically be impossible, if package is installed correctly.

Seriously, try reinstalling. Sometimes updates fail for no apparent reason and mess up everything horribly.

hnn commented 8 years ago

The reinstall worked (I uninstalled all packages from atom-haskell, closed Atom, reopened Atom and installed all again).

Thanks for your help!

lierdakil commented 8 years ago

Glad to hear that.