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

Cannot read property 'split' of undefined #128

Closed cnd closed 8 years ago

cnd commented 8 years ago
TypeError: Cannot read property 'split' of undefined
    at Object.module.exports.Util.getProcessOptions (file:///C:/Users/Rainbow/.atom/packages/haskell-ghc-mod/lib/util.coffee:60:35)
lierdakil commented 8 years ago

This could happen only if you don't have PATH set. Which usually means something's gone horribly wrong. Either that, or Atom botched an update. Try reinstalling the package, or cleaning compilation cache (.atom/compile-cache).

cnd commented 8 years ago

it's happened after fresh installation on 1.7 beta 0 / cleaning cache doesn't help

lierdakil commented 8 years ago

This seems related to https://github.com/atom/atom/pull/11054 then

Check to see if process.env is sane. Especially if there's PATH there. If you're on Windows, check for different capitalizations as well.

You can use dev. console to check for those.

Thanks.

doivosevic commented 8 years ago

I have edited the coffeescript file and changed process.env.PATH to process.env.Path and now it seems to work

lierdakil commented 8 years ago

@DominikDitoIvosevic -- that's not a solution though. Windows has this weird thing where it collects differently capitalized environment variables into one, and node did collect all of those (path, Path, etc) into PATH. I wonder if atom/atom#11054 breaks this.

cnd commented 8 years ago

@DominikDitoIvosevic yes, thanks it looks like step forward

now I get my regular

message: Invalid option `-p'

Usage: ghc-mod browse [-o|--operators] [-d|--detailed] [-q|--qualified] MODULE
cnd commented 8 years ago

And if I even comment out -p from coffee I'm getting:

CabalHelper\Licenses.hs:38:28:
    Not in scope: `lookupComponentId'
    Perhaps you meant one of these:
      `lookupComponent' (imported from Distribution.Simple.LocalBuildInfo),
      `localComponentId' (imported from Distribution.Simple.LocalBuildInfo)
cnd commented 8 years ago

ah this should be related https://github.com/DanielG/cabal-helper/commit/c2d116272b448342629e6beb73fe7a464e2245d3

cnd commented 8 years ago

however maybe it's not fully sychronized with live cabal sources

CabalHelper\Main.hs:217:43:
    Couldn't match type `GhcOptions -> [String]' with `[String]'

    Expected type: [(ChComponentName, [String])]
      Actual type: [(ChComponentName, GhcOptions -> [String])]
    In the first argument of `(++)', namely `res'
    In the first argument of `ChResponseCompList', namely
      `(res ++ [(ChSetupHsName, [])])'

CabalHelper\Main.hs:231:43:
    Couldn't match type `GhcOptions -> [String]' with `[String]'
    Expected type: [(ChComponentName, [String])]
      Actual type: [(ChComponentName, GhcOptions -> [String])]
    In the first argument of `(++)', namely `res'
    In the first argument of `ChResponseCompList', namely
      `(res ++ [(ChSetupHsName, [])])'

CabalHelper\Main.hs:239:43:
    Couldn't match type `GhcOptions -> [String]' with `[String]'
    Expected type: [(ChComponentName, [String])]
      Actual type: [(ChComponentName, GhcOptions -> [String])]
    In the first argument of `(++)', namely `res'
    In the first argument of `ChResponseCompList', namely
      `(res ++ [(ChSetupHsName, [])])'

CabalHelper\Main.hs:253:33:
    Couldn't match type `GhcOptions -> [String]' with `[String]'
    Expected type: IO [String]
      Actual type: IO (GhcOptions -> [String])
    In the second argument of `(<$>)', namely
      renderGhcOptions' lbi v res'
    In a stmt of a 'do' block:
      Just . ChResponseList <$> renderGhcOptions' lbi v res'

CabalHelper\Main.hs:253:57:
    Couldn't match expected type `Distribution.System.Platform'
                with actual type `GhcOptions'
    In the third argument of renderGhcOptions', namely res'
    In the second argument of `(<$>)', namely
      renderGhcOptions' lbi v res'

CabalHelper\Main.hs:263:43:
    Couldn't match type `GhcOptions -> [String]' with `[String]'
    Expected type: [(ChComponentName, [String])]
      Actual type: [(ChComponentName, GhcOptions -> [String])]
    In the first argument of `(++)', namely `res'
    In the first argument of `ChResponseCompList', namely
      `(res ++ [(ChSetupHsName, [])])'

CabalHelper\Main.hs:355:59:
    Couldn't match type `GhcOptions'
                   with `Distribution.System.Platform'
    Expected type: LocalBuildInfo
                   -> Verbosity -> GhcOptions -> IO (GhcOptions -> [String])
      Actual type: LocalBuildInfo
                   -> Verbosity
                   -> Distribution.System.Platform
                   -> IO (GhcOptions -> [String])
    In the fourth argument of componentOptions', namely
      renderGhcOptions'
    In the expression:
      componentOptions'
        (lbi, v, distdir) inplaceFlag flags renderGhcOptions' f
lierdakil commented 8 years ago

@Heather, for the love of all that is holy, disable 'Experimental' option in haskell-ghc-mod. It's not what you think it is.

lierdakil commented 8 years ago

Let me know if there are still PATH-related issues on Windows after 1.11.4.

cnd commented 8 years ago

issue with PATH is gone