question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

this.disposable is undefined

See original GitHub issue

Summary

I have run into a case where the typeof check below returns undefined:

SliceSink.prototype.dispose = function () {
  console.log("calling dispose", typeof this.disposable)
  console.log("this", this)
  return this.disposable.dispose()
}
TypeError: Cannot read property 'dispose' of undefined
    at SliceSink.dispose (build/main.js:20834:25)
    at SliceSink.event (build/main.js:20826:10)
    at tryEvent (build/main.js:2483:10)
    at SubscriberSink.next (build/main.js:22463:92)
    at SubscriptionObserver.next (build/main.js:23958:14)
    at observerNext (build/main.js:6253:16)
    at addListener (build/main.js:18989:17)
    at attachListenerToElement (build/main.js:19101:13)
    at utils.forEach (build/main.js:5604:22)
    at Object.listenTo (build/main.js:19025:9)

Expected result

this.disposable should never be undefined or a better error for the user.

Actual Result

this.disposable is undefined

Versions

  • most.js: ^1.2.2

Steps to reproduce

See code below

Code to reproduce

const FRP = require("most")
const Observable = require("zen-observable")



const makeProblemStream = () =>
  new Observable((observer) => {
    observer.next(1) // <-- Triggers error
    const intervalId = setInterval(
      () => { observer.next(1) },
      1000
    )
    return () => clearInterval(intervalId)
  })

FRP
.from(makeProblemStream())
.take(1)
.drain()
.catch(console.error)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
jasonkuhrtcommented, Apr 20, 2017

Could you try it in your larger use case to see if it helps there as well?

Hey @briancavalier I just tried out your branch in forto and it works!

On a side note, just wanted say thanks for your fantastic OSS contributions. More over, you conduct yourself with an amazing humility and humanity… its always a pleasure to interact with you!

1reaction
briancavaliercommented, Apr 19, 2017

Great, thanks @jasonkuhrt. I’ll start to dig into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Disposable Pattern in TypeScript - Blog
The Disposable Pattern in TypeScript. Sep 7, 2019 ... myClass !== undefined); this.dispose.untrack(this.myClass).dispose(); this.myClass = undefined; // .
Read more >
Error thrown for reading disposable email - Javascript
I am particularly using https://maildrop.cc/ to send the emails from external source and reading it. I have tried to use code mentioned here: ......
Read more >
Complete Guide to Using Koi 2-Gram Disposable Vapes ...
Our Koi 2-Gram Disposable Vape Bars are the fastest, easiest, and arguably most enjoyable way to experience the benefits of cannabinoids. These ...
Read more >
How to use the monaco-editor.editor.createModel function ...
disposable.add( (this.baseModel = monacoEditor.createModel( this.file.baseRaw, undefined, new Uri( ...
Read more >
XTRA FLAVORS
This products contains Nicotine. ... XTRA® started its humble beginnings with a clear vision that disposable devices are the future of vaping.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found