mobx: [issue] "e.observing is null" since last update of firefox

Hello, our app started to have an issue on Firefox with their last update:

e.observing is null

with mobx: 2.5.2, mobx-react: 3.5.6,

(for example I had FF 47.8, I think, and it updated to 49.0.1)

Since then we have an issue related to a <select /> which values are observables. When a value is selected, it throws e.observing is null.

This bug was confirmed by various people, developers and customers.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 25 (10 by maintainers)

Most upvoted comments

Had a similar issue. Older version of Firefox worked fine, latest (51.0.1) would fail with observing is null error. Seems to be similar to what @drewhamlett showed above.

Our problem was that we had a component with the @observer attribute but the component had nothing to observe:

import React, { Component } from 'react';
import { observer } from 'mobx-react';

@observer
export default class ContentFooter extends Component {
  render() {
    return (
      <div className="footer" />
    );
  }
}

Removed the @observer attribute and it worked.

“mobx”: “^2.7.0” “mobx-react”: “^4.0.4”

@jmca Thanks, this solve the observing is null issue for me too.

@AoDev Here’s my upgrade path: mobx: 2.6.0 --> 2.7.0 mobx-react: 3.5.7 --> 4.0.3

I ran into this too under similar conditions (an @observer component that doesn’t listen to any observables, but has child @observer components that do). While I haven’t found a reproducible small test case, I do have a repo that exhibits the issue. It seems like we’re hitting a Firefox JS engine bug, as unlikely as that sounds, but I haven’t found a matching bug in Bugzilla. That would corroborate the reports that this only happens in certain environments (prod vs. dev, maybe related to the level of optimizations kicking in?).

In bindDependencies, under certain conditions, the assignment derivation.newObserving = null appears to be taking effect before the assignment of observing and derivation.observing. In this screenshot, note the values of window.a (displayed in the console) and b (displayed in the sidebar): a is an Array[100] as expected, but b is null when it should be the same object as a.

Moving the derivation.newObserving = null assignment later in the function (e.g. after the first loop) seems to mitigate the problem, as do various other benign tweaks to the function. Unfortunately, if the cause is truly a Firefox JS engine bug, that would only be a bandaid. This doesn’t seem to be a problem with mobx itself.

I was able to repro with the following:

  1. Clone https://github.com/mozilla-sensorweb/sensorweb-website/tree/mobx (note the mobx branch)
  2. install, ideally just npm install && npm run build
  3. open build/index.html
  4. click a couple times on the “month” button in the sidebar

disclaimer: I work for Mozilla but not on the Firefox team.