Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Uncaught TypeError: Path must be a string. Received undefined #435

Open
w2ak opened this issue Apr 14, 2017 · 14 comments
Open

Uncaught TypeError: Path must be a string. Received undefined #435

w2ak opened this issue Apr 14, 2017 · 14 comments

Comments

@w2ak
Copy link

w2ak commented Apr 14, 2017

[Enter steps to reproduce:]

  1. Open any project with atom.
  2. Go to the finder and open another file from anywhere with Atom. It should open in the same Atom window as the project you opened before.
  3. Click on a tab, try to close the file tab for example.
  4. The error should happen.

Atom: 1.16.0 x64
Electron: 1.3.13
OS: Mac OS X 10.12.3
Thrown From: tabs package 0.104.2

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:7

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.join (path.js:1213:7)
    at Object.tildify (/app.asar/node_modules/fs-plus/lib/fs-plus.js:64:39)
    at Workspace.updateWindowTitle (/app.asar/src/workspace.js:259:24)
    at observeActivePaneItem.item (/app.asar/src/workspace.js:184:12)
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at /app.asar/src/pane-container.js:348:27
    at Function.module.exports.Emitter.simpleDispatch (/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/app.asar/node_modules/event-kit/lib/emitter.js:129:28)
    at Pane.module.exports.Pane.setActiveItem (/app.asar/src/pane.js:300:22)
    at Pane.module.exports.Pane.activateItem (/app.asar/src/pane.js:452:21)
    at TabBarView.module.exports.TabBarView.onMouseDown (/app.asar/node_modules/tabs/lib/tab-bar-view.js:678:19)

Commands

Non-Core Packages

autocomplete-python 1.8.63 
build 0.67.0 
busy 0.7.0 
language-latex 1.0.0 
minimap 4.27.1 
terminal-plus 0.14.5 
vim-mode-plus 0.87.0 
@rsese
Copy link

rsese commented Apr 19, 2017

Hmmm, I tried your steps to reproduce but didn't see the error - I closed the file that I opened in your step (2).

Is the error reproducible for you? If so, is it reproducible in safe mode (atom --safe)?

@w2ak
Copy link
Author

w2ak commented Apr 19, 2017 via email

@kellyjandrews
Copy link

kellyjandrews commented Apr 19, 2017

Running atom --safe worked for me.

I was able to reproduce by clicking tabs, closing tabs, creating a new file, removing project folders (tree-view). All of them were derivatives of TypeError: Path must be a string. Received undefined.

@rsese
Copy link

rsese commented Apr 27, 2017

This is actually quite weird : now I get the error every time I try to open a project in atom. And in safe mode, I can open a file but not a folder. There is no “error”, but the folder never actually opens.

Huh that is weird @w2ak - when you say you can't open a folder, you mean that File > Add Project Folder does nothing?

Can you also try temporarily moving your ~/.atom directory 1 and see if that makes a difference?

mv ~/.atom ~/.atom-backup

Running atom --safe worked for me.

I was able to reproduce by clicking tabs, closing tabs, creating a new file, removing project folders (tree-view). All of them were derivatives of TypeError: Path must be a string. Received undefined.

@kellyjandrews - if there's no issue in safe mode, then that likely means a community package is causing the issue:

http://flight-manual.atom.io/hacking-atom/sections/debugging/#using-safe-mode

You can disable each community package one by one to try and pinpoint which is causing the problem.

@arkholt
Copy link

arkholt commented Apr 29, 2017

I've been receiving this error for some time now. I've discovered that I don't see the error when using atom --safe, but I also attempted to simply open Atom using the terminal command (without --safe) and I also don't receive the error. Safe mode doesn't seem to be removing the error, but launching from the command line does.

@dnedrow
Copy link

dnedrow commented May 30, 2017

I am able to duplicate this at will with both 1.17.2 and 1.18.0-beta2 on macOS Sierra. If I delete the ~/.atom directory and start the app using Finder all of the default tabs work fine. As soon as I try to open a file, the exception starts throwing immediately as I change tabs.

As @arkholt noted, this does not happen if I start Atom via terminal, regardless of whether I use the --safe flag.

The exception looks like it is propagating out of tildify. I have no community packages installed.

This is a particularly irritating bug.
TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.join (path.js:1213:7) at Proxy.tildify (/Users/n648892/Applications/Atom.app/Contents/Resources/app/node_modules/fs-plus/lib/fs-plus.js:71:1) at Workspace.updateWindowTitle (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/workspace.js:643:1) at Workspace.didChangeActivePaneItem (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/workspace.js:497:1) at Workspace.didActivatePaneContainer (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/workspace.js:471:1) at Dock.subscriptions.CompositeDisposable.paneContainer.onDidActivatePane (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/dock.js:57:1) at Function.module.exports.Emitter.simpleDispatch (/Users/n648892/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:25:1) at Emitter.module.exports.Emitter.emit (/Users/n648892/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:141:1) at PaneContainer.didActivatePane (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/pane-container.js:260:1) at Pane.module.exports.Pane.activate (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/pane.js:875:1) at Pane.module.exports.Pane.focus (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/pane.js:269:1) at atom-pane.<anonymous> (/Users/n648892/Applications/Atom.app/Contents/Resources/app/src/pane-element.js:51:25)

@dnedrow
Copy link

dnedrow commented Jun 1, 2017

@rsese

Can the tags be updated now that more information has been provided and its happening even without any community packages installed?

-David

@rsese
Copy link

rsese commented Jun 1, 2017

I tried reproducing again but wasn't able to - @ungb can you give it a try when you have a moment? The most recent steps seem to be (correct me if I'm wrong @dnedrow or anyone else seeing this error):

  1. Temporarily reset to factory defaults.
  2. Start Atom through Finder.
  3. Open a file with cmd-o
  4. Click on the other open tabs

Edit: this on macOS Sierra and Atom 1.17.2 or 1.18.0-beta2

@witto
Copy link

witto commented Jun 21, 2017

Exactly the same thing here. Maybe it has anything to do with FileVault? Do you guys also have it enabled?

@rsese
Copy link

rsese commented Jun 21, 2017

I have FileVault enabled 👍 and I tried to reproduce again on stable 1.18.0 but still wasn't able to.

I looked at the stack trace again and I remembered this issue:

atom/status-bar#184

Can anyone hitting this error open dev tools (View > Developer > Toggle Developer Tools) and share the output of this command?

process.env.HOME

@rsese
Copy link

rsese commented Jun 21, 2017

Oh also, the fix for that issue I mentioned above is in the 1.19 beta but not 1.18.0, would anyone be able to give the latest beta a try and let us know if you see the error there or not?

@witto
Copy link

witto commented Jun 28, 2017

The problem stopped for a few days after I started Atom via command line but now it started again.

Here is the console output for the command you asked:
path.js:7 Uncaught (in promise) TypeError: Path must be a string. Received undefined(…)
2path.js:7 Uncaught TypeError: Path must be a string. Received undefined
process.env.HOME
undefined

I'll install 1.19 beta to see if it goes away.

Thanks

@surpher
Copy link

surpher commented Jul 4, 2017

@rsese process.env.HOME -> undefined, v1.18.0
process.env.ATOM_HOME -> /Users/_username_/.atom, v1.19.0-beta2. The TypeError exception hasn't yet popped up.

@witto
Copy link

witto commented Jul 4, 2017

Just an update, I've been using the beta for the last week and haven't had any problem so far.

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

No branches or pull requests

7 participants