atom / tabs

Tabs in Atom
MIT License
111 stars 115 forks source link

Uncaught TypeError: Cannot read property 'replaceChild' of null #510

Open ChengmingLu opened 6 years ago

ChengmingLu commented 6 years ago

[Enter steps to reproduce:]

  1. Create AnyName.md, open in Atom
  2. Without quitting Atom, close the file and rename to anything with spaces
  3. Drag the renamed file into Atom
  4. Toggle Markdown Preview
  5. Close the file

Atom: 1.19.0 x64 Electron: 1.6.9 OS: Mac OS X 10.12.6 Thrown From: tabs package 0.106.2

Stack Trace

Uncaught TypeError: Cannot read property 'replaceChild' of null

At /Applications/Atom.app/Contents/Resources/app/src/pane-axis.js:232

TypeError: Cannot read property 'replaceChild' of null
    at PaneAxis.module.exports.PaneAxis.reparentLastChild (/Applications/Atom.app/Contents/Resources/app/src/pane-axis.js:232:24)
    at PaneAxis.module.exports.PaneAxis.removeChild (/Applications/Atom.app/Contents/Resources/app/src/pane-axis.js:197:27)
    at /Applications/Atom.app/Contents/Resources/app/src/pane-axis.js:240:30
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:20)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:34)
    at Pane.module.exports.Pane.destroy (/Applications/Atom.app/Contents/Resources/app/src/pane.js:931:28)
    at Pane.module.exports.Pane.removeItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:650:27)
    at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:706:22)
    at TabBarView.module.exports.TabBarView.closeTab (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:340:32)
    at HTMLDivElement.TabView.didClickCloseIcon (/Applications/Atom.app/Contents/Resources/app/node_modules/tabs/lib/tab-bar-view.js:228:25)

Commands

  3x -0:26.6.0 markdown-preview:toggle (input.hidden-input)

Non-Core Packages

rsese commented 6 years ago

Thanks for the report! I wasn't able to reproduce with your steps - can you confirm if the error is reproducible in safe mode (atom --safe)?

Also, can you clarify this step?

  1. Without quitting Atom, close the file and rename to anything with spaces

I renamed the file outside of Atom (from the command line specifically), is that what you did too?

ChengmingLu commented 6 years ago

To clarify step 2, I kept Atom open but closed the file, then I renamed the file from ReadMe.md to something like Read Me First.md and that's basically what step 2 means.

After that I dragged the renamed file to Atom to reopen it. Then I toggled Markdown Preview, nothing happened(preview did not show up). Finally I closed the file again and the error message showed up. Note that after the renamed file has been closed, Atom's title bar showed the filename before it was renamed.

Unfortunately like you said, even I could not reliably reproduce the issue with these steps myself. (Maybe I should not have treated these steps as "steps to reproduce", but "steps that originally caused the issue" rather)

Ben3eeE commented 6 years ago

@cluster626 Thanks for clarifying. That is really helpful 🙇