Floobits / atom-term3

Open Terminal tabs in Atom. Fork of Term package
Other
88 stars 17 forks source link

Uncaught TypeError: Cannot read property 'null' of undefined #63

Closed JulianTonti closed 8 years ago

JulianTonti commented 8 years ago

Atom Version: 1.8.0 System: Mac OS X 10.11.5 Thrown From: term3 package, v0.22.0

Normally, term3 has no problem sharing a Pane with other Tabs, even when the Tabs are other term3 instances. But under the following condition, another Tab in the same Pane as a term3 instance causes an exception that keeps re-occurring endlessly, even when the Pane is removed. Here's how to replicate it:

0: starting from a blank slate

image

1: create a term3 instance in any pane with ctrl-option-t, then use it to touch a file and open it in Atom (the file must exist for the error to occur).

image

2: the file should open under a new Tab in the same Pane as the term3 instance.

image

3: now try to do anything at all in the editor (even clicking to focus, switch tabs or close tabs):

image

4: the error keeps re-occurring, even if the offending Pane is terminated:

image

Stack Trace

Uncaught TypeError: Cannot read property 'null' of undefined

At /Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactMount.js:510

TypeError: Cannot read property 'null' of undefined
    at Object.ReactMount.findReactContainerForID (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactMount.js:510:50)
    at findParent (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactEventListener.js:46:30)
    at handleTopLevelImpl (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactEventListener.js:81:16)
    at ReactDefaultBatchingStrategyTransaction.Mixin.perform (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/Transaction.js:141:20)
    at Object.ReactDefaultBatchingStrategy.batchedUpdates (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactDefaultBatchingStrategy.js:70:19)
    at Object.batchedUpdates (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactUpdates.js:113:20)
    at ReactEventListener.dispatchEvent (/Users/julian/.atom/packages/term3/node_modules/react-atom-fork/lib/ReactEventListener.js:186:20)

Commands

  4x -2:38.7.0 term3:open (atom-pane.pane.active)
  2x -0:05.4.0 core:backspace (atom-workspace.workspace.scrollbars-visible-always.theme-base16-tomorrow-light-theme.theme-one-light-ui)

Config

{
  "core": {
    "destroyEmptyPanes": false,
    "disabledPackages": [
      "autocomplete-plus",
      "autocomplete-html",
      "autocomplete-css",
      "autocomplete-atom-api",
      "autocomplete-snippets",
      "activate-power-mode",
      "terminal-plus",
      "minimap"
    ],
    "openEmptyEditorOnStart": false,
    "themes": [
      "one-light-ui",
      "base16-tomorrow-light-theme"
    ]
  },
  "term3": {
    "autoRunCommand": "login -f `whoami`",
    "colors": {
      "background": {
        "red": 255,
        "green": 255,
        "blue": 255,
        "alpha": 1
      },
      "foreground": {
        "red": 0,
        "green": 0,
        "blue": 0,
        "alpha": 1
      }
    },
    "fontFamily": "monaco",
    "fontSize": "10px"
  }
}

Installed Packages

# User
Sublime-Style-Column-Selection, v1.5.1
term3, v0.22.0

# Dev
No dev packages
JulianTonti commented 8 years ago

Interestingly, If I open a file in term3 using open -a Atom filename then the error does not occur.

The error only occurs if I type atom filename, where atom symlinks to the atom.sh script located with the Atom.app: /Applications/Atom.app/Contents/Resources/app/atom.sh

Located online here: https://github.com/atom/atom/blob/master/atom.sh

ggreer commented 8 years ago

Thanks for the detailed bug report. It made it much easier for me to reproduce the issue.

ggreer commented 8 years ago

This might be a bug in Atom. For some reason, process.env.NODE_ENV is being unset, causing the error in findReactContainerForID(). Term3 definitely doesn't mess with that.

ggreer commented 8 years ago

OK, try the latest version of Term3 (v0.22.1). It works around this bug in Atom.

JulianTonti commented 8 years ago

Updated to 0.22.1, restarted Atom and indeed the error is fixed.

Thankyou!