-
-
Notifications
You must be signed in to change notification settings - Fork 96
Uncaught TypeError: Path must be a string. Received null #67
Comments
This is happening to me as well. It started occurring upon upgrading prettier-atom to 0.21.0 |
I'm on it! |
There may be cases where an editor will return a null filePath (such as when saving a new file). Previously, doing so would cause an error because we assumed its presence when looking for the nearest `.eslintignore` file. The solution is to short-circuit this check if the filePath is not present, since there's no way it can be ignored if it doesn't have a path anyway. Fixes #67
Wow @robwise that was FAST! |
@thtliife @ryancole @skevy I just released a new version that hopefully addresses the bug. I apologize; I had to change a bunch of stuff under the hood when integrating prettier-eslint and this bug crept in. Could you update to the latest and verify that it fixes your use cases? I was able to reproduce locally and then my fix seemed to resolve it, but I just want to make sure you're all set.
So happy to hear it! |
I'm getting the same issue on version 0.21.1 but an empty |
Okay, was a double bug, fixing that now |
We were not properly handling the case where no `.eslintignore` was found when attempting to determine whether to run `formatOnSave`. Now, if no `.eslintignore` is found, we short circuit and assume the file is not ignored. Fixes #67 (again)
I was able to reproduce the eslintignore problem as well and wrote a fix that seems to resolve it. I got thrown off because I actually encountered and fixed an unreported bug the first time. This should now fix the actual bug you were describing. I just published 0.21.2. Can someone confirm the problem is solved? |
Confirmed fixed in v0.21.2 |
Thanks @robwise for the quick turnaround!! |
Thanks @robwise! Take care of yourself :) |
[Enter steps to reproduce:]
.js
file, with format-on-save enabled. This was working like 10 minutes ago but is no longer working. After receiving the error a first time, I was prompted to updated Atom. I updated Atom and am still getting the error.Atom: 1.14.4 x64
Electron: 1.3.13
OS: Microsoft Windows 10 Pro
Thrown From: prettier-atom package 0.21.0
Stack Trace
Uncaught TypeError: Path must be a string. Received null
Commands
Non-Core Packages
The text was updated successfully, but these errors were encountered: