atom-haskell / ide-haskell-repl

GHCi REPL in Atom
https://atom.io/packages/ide-haskell-repl
MIT License
26 stars 8 forks source link

Uncaught TypeError: Cannot read property 'startsWith' of undefined #18

Closed matthieubulte closed 8 years ago

matthieubulte commented 8 years ago

Got an exception when I tried to open my REPL after upgrading to the last version

I tried to follow the stack trace, it is caused by comp being undefined, this variable is defined in the same file at line 67: [comp] = Util.getComponentFromFileSync cabalContents, @cwd.relativize(@uri) The problem is that the array returned is empty. The relative url seems to be fine. Then comes the GHCJS runtime and I couldn't debut anything anymore.

Thanks!

Atom Version: 1.5.3 System: Mac OS X 10.10.5 Thrown From: ide-haskell-repl package, v0.0.18

Stack Trace

Uncaught TypeError: Cannot read property 'startsWith' of undefined

At /Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl-view.coffee:73

TypeError: Cannot read property 'startsWith' of undefined
    at new IdeHaskellReplView (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl-view.coffee:73:14)
    at /Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:34:18
    at Workspace.module.exports.Workspace.openURIInPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:465:22)
    at Workspace.module.exports.Workspace.open (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:404:19)
    at Object.module.exports.IdeHaskellRepl.open (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:64:20)
    at atom-text-editor.disposables.add.atom.commands.add.ide-haskell-repl:toggle (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:40:10)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1013:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)

Commands

     -0:04.5.0 core:save (atom-text-editor.editor.is-focused)
     -0:04.5.0 ide-haskell:prettify-file (atom-text-editor.editor.is-focused)
     -0:01.5.0 ide-haskell-repl:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "atom-typescript"
    ],
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "ide-haskell-repl": {
    "commandArgs": [
      "ghci"
    ],
    "commandPath": "stack"
  }
}

Installed Packages

# User
autocomplete-haskell, v0.6.2
haskell-ghc-mod, v1.9.6
ide-haskell, v1.5.2
ide-haskell-repl, v0.0.18
language-haskell, v1.7.1
language-ocaml, v1.1.2
language-purescript, v0.6.1
linter, v1.11.3
local-history, v3.2.3
seti-syntax, v0.4.1
seti-ui, v0.9.1
wordcount, v2.6.0

# Dev
No dev packages
lierdakil commented 8 years ago

Do you run it on cabal/stack project, or is it just plain old "bunch of files"?

Array in question could be empty if Cabal (the library) couldn't assign uri to a component (e.g. lib/exe/test). 1 марта 2016 г. 18:06 пользователь "matthieubulte" notifications@github.com написал:

  1. Just tried to open my REPL after upgrading to the last version

I tried to follow the stack trace, it is caused by comp being undefined, this variable is defined in the same file at line 67: [comp] = Util.getComponentFromFileSync cabalContents, @cwd.relativize(@uri) The problem is that the array returned is empty. The relative url seems to be fine. Then comes the GHCJS runtime and I couldn't debut anything anymore.

Atom Version: 1.5.3 System: Mac OS X 10.10.5 Thrown From: ide-haskell-repl https://github.com/atom-haskell/ide-haskell-repl package, v0.0.18 Stack Trace

Uncaught TypeError: Cannot read property 'startsWith' of undefined

At /Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl-view.coffee:73

TypeError: Cannot read property 'startsWith' of undefined at new IdeHaskellReplView (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl-view.coffee:73:14) at /Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:34:18 at Workspace.module.exports.Workspace.openURIInPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:465:22) at Workspace.module.exports.Workspace.open (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:404:19) at Object.module.exports.IdeHaskellRepl.open (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:64:20) at atom-text-editor.disposables.add.atom.commands.add.ide-haskell-repl:toggle (/Users/mbulte/.atom/packages/ide-haskell-repl/lib/ide-haskell-repl.coffee:40:10) at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29) at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61) at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19) at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1013:28) at emitOne (events.js:77:13) at EventEmitter.emit (events.js:169:7)

Commands

 -0:04.5.0 core:save (atom-text-editor.editor.is-focused)
 -0:04.5.0 ide-haskell:prettify-file (atom-text-editor.editor.is-focused)
 -0:01.5.0 ide-haskell-repl:toggle (atom-text-editor.editor.is-focused)

Config

{ "core": { "disabledPackages": [ "atom-typescript" ], "themes": [ "seti-ui", "seti-syntax" ] }, "ide-haskell-repl": { "commandArgs": [ "ghci" ], "commandPath": "stack" } }

Installed Packages

User

autocomplete-haskell, v0.6.2 haskell-ghc-mod, v1.9.6 ide-haskell, v1.5.2 ide-haskell-repl, v0.0.18 language-haskell, v1.7.1 language-ocaml, v1.1.2 language-purescript, v0.6.1 linter, v1.11.3 local-history, v3.2.3 seti-syntax, v0.4.1 seti-ui, v0.9.1 wordcount, v2.6.0

DevNo dev packages

— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/ide-haskell-repl/issues/18.

matthieubulte commented 8 years ago

Thanks for answering so fast! It's a stack project that worked just fine before installing the last upgrades that came today.

lierdakil commented 8 years ago

0.0.19 should work.

Bear in mind though that component assignment probably didn't work in the first place for you (and it won't with 0.0.19). This could either mean that your .cabal file is configured incorrectly (i.e. not all modules are mentioned there), or there is a bug in my Haskell code somewhere.

matthieubulte commented 8 years ago

Works now, thanks!