Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'length' of undefined #192

Closed
marcosh opened this issue Oct 13, 2017 · 9 comments
Closed

Uncaught TypeError: Cannot read property 'length' of undefined #192

marcosh opened this issue Oct 13, 2017 · 9 comments

Comments

@marcosh
Copy link

marcosh commented Oct 13, 2017

As I try to compile my Idris code in Atom I get the following error:

/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:78

The stacktrace of the error is:

TypeError: Cannot read property 'length' of undefined
    at IdrisController.displayErrors (/home/marcosh/.atom/packages/language-idris/lib/idris-controller.coffee:507:5)
    at AnonymousObserver._onError (/home/marcosh/.atom/packages/language-idris/lib/idris-controller.coffee:1:1)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.error (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1643:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1579:14)
    at AnonymousObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.error (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6268:52)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1579:14)
    at InnerObserver.error (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:4667:14)
    at InnerObserver.Rx.internals.AbstractObserver.AbstractObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1579:14)
    at InnerObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.error (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6268:52)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1579:14)
    at MergeAllObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:3237:16)
    at MergeAllObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.error (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6268:52)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onError (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1579:14)
    at InnerObserver.Rx.FlatMapObservable.InnerObserver.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1872:48)
    at InnerObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at InnerObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6260:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at loopRecursive (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:2412:18)
    at Rx.internals.ScheduledItem.invokeRecImmediate [as action] (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:929:7)
    at Rx.internals.ScheduledItem.ScheduledItem.invokeCore (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:858:33)
    at Rx.internals.ScheduledItem.ScheduledItem.invoke (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:846:40)
    at runTrampoline (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1045:37)
    at tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at CurrentThreadScheduler.schedule (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1061:45)
    at FilterObservable.Rx.ObservableBase.ObservableBase._subscribe (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1826:32)
    at FilterObservable.Rx.Observable.observableProto.subscribe.observableProto.forEach (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1703:19)
    at IdrisController.typecheckFile (/home/marcosh/.atom/packages/language-idris/lib/idris-controller.coffee:154:8)
    at /home/marcosh/.atom/packages/language-idris/lib/idris-controller.coffee:1:1
    at AnonymousObserver._onNext (/home/marcosh/.atom/packages/language-idris/lib/idris-controller.coffee:102:11)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1635:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at AnonymousObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6260:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at CatchObserver.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:2747:59)
    at CatchObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at CatchObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6260:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at InnerObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:3263:90)
    at InnerObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6260:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at InnerObserver.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:4329:14)
    at InnerObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at InnerObserver.tryCatcher (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:64:31)
    at AutoDetachObserverPrototype.next (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6260:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:1569:31)
    at AsyncSubject.onCompleted (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:6462:17)
    at handler (/home/marcosh/.atom/packages/language-idris/node_modules/rx-lite/rx.lite.js:4766:7)
    at tryToString (fs.js:426:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:413:12)
@justjoheinz
Copy link
Contributor

Have you set the path to the idris executable in the package settings correclty. E.g. "/usr/local/bin/idris" - that is including the name of the executable?

@melted
Copy link
Contributor

melted commented Oct 14, 2017

We should probably give a proper user-visible error whenever Idris can't be found.

@marcosh
Copy link
Author

marcosh commented Oct 14, 2017

@justjoheinz the path to the idris executable is correct.

I should have mentioned that everything was working until some days ago. The only relevant change I can recall was starting to use the effects pakage

@justjoheinz
Copy link
Contributor

Can you post your ipgk file please?

@marcosh
Copy link
Author

marcosh commented Oct 16, 2017

This happens even without an .ipkg file.

The first time I try to compile I get a message like The Idris compliler was closed or crashed. It (probably) crashed with the error code: 1.

If I try to recompile I get the error reported above

@justjoheinz
Copy link
Contributor

this is strange. Can you start idris from the command line? Does the output of which idris match what you have configured in your atom settings?

@marcosh
Copy link
Author

marcosh commented Oct 16, 2017 via email

@marcosh
Copy link
Author

marcosh commented Oct 17, 2017

This morning I tried to investigate this issue a bit. Now I got everything working correctly again.

I guess, but I'm not sure, that the problem was generated in the following way:

  • a somehow incorrect .ipkg file was making idris crash inside of atom.
  • every other use of the Idris extension in Atom would report the error object of this issue

Moreover, I noticed the same behaviour also on visual studio code, so this is not strictly related to Atom.

Thanks a lot for your time and for the help.
as far as I'm concerned, you can close the issue now.

@justjoheinz
Copy link
Contributor

There is also the possibility that you had a file which is called like one of the Prelude files in your directory, e.g. IO.idr or something like that. That will freak out idris, but you should not have been able to start idris with that file. Anyway - thanks for taking the time to report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants