You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
Edit: I've been able to narrow down the cause of this, which makes it a pretty minor error... but here goes -
I've noticed that when I type something up in a new .js file that is not attached to any npm project the current Atom project (i.e. just create a new file and save it to my desktop), it always prints the following message every time I save:
path should be a path.relative()d string, but got "/Users/me/my/new/file.js"
Looking at dev tools, it looks like it crashes here:
If I disable Format on Save, the error does not print. Specifically, the .ignores() call is what is failing. I see that relativizePathFromAtomProject() isn't returning a relative path and that ignores() is getting an absolute one instead.
Any ideas? If anyone can suggest the fix, I would be happy to help.
It seems like you are right on with your diagnosis here. Just as some background, in order to check against any whitelist/exclude globs, we use the ignores package. They unfortunately made it so it throws a hard error unless you give a path that is relative (as opposed to absolute).
So what we've been doing is using relativizePathFromAtomProject to get us the relative path version of your file. It seems that since you're not in a project here, it's falling back to just giving an absolute path.
All we need to do really is just change the path in such a way that the ignores package is happy (that it identifies via regex that the path is relative).
One solution I guess we could try would be detecting whether there is a project present, and if not, don't call relativizePathFromAtomProject and instead turn /Foo/Bar/Baz to ./Foo/Bar/Baz?
I dunno, maybe that's a bit hacky?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
Edit: I've been able to narrow down the cause of this, which makes it a pretty minor error... but here goes -
I've noticed that when I type something up in a new .js file that is not attached to
any npm projectthe current Atom project (i.e. just create a new file and save it to my desktop), it always prints the following message every time I save:Looking at dev tools, it looks like it crashes here:
helpers/general.js
const someGlobsMatchFilePath = (globs, filePath) => isPresent(filePath) && ignore().add(globs).ignores(filePath);
If I disable Format on Save, the error does not print. Specifically, the
.ignores()
call is what is failing. I see thatrelativizePathFromAtomProject()
isn't returning a relative path and thatignores()
is getting an absolute one instead.Any ideas? If anyone can suggest the fix, I would be happy to help.
The text was updated successfully, but these errors were encountered: