Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(wrong-type-argument hash-table-p nil) when running projectile-current-project-files #496

Closed
rpdillon opened this issue Oct 30, 2014 · 5 comments

Comments

@rpdillon
Copy link

Debugged a bit.
Line 1193 of projectile.el:

(gethash (projectile-project-root) projectile-projects-cache))))

where, in my project, projectile-projects-cache is nil (and I have caching enabled).

gethash doesn't appear to accept nil for the hashtable, as is the default (line 353).

Emacs 24.4, Arch Linux, latest packages from Melpa (as of this morning).

Update:
(setq projectile-projects-cache (make-hash-table))
seems to solve the issue until restart, when it defaults back to nil.

@trishume
Copy link
Contributor

Spacemacs had the same error and created this bug: #486

It turned out to be a problem with the way projectile was being used, fixed by this commit:
syl20bnr/spacemacs@20de49c

Not sure if that can help your problem, but I think something similar might be going on for you.

@rpdillon
Copy link
Author

rpdillon commented Nov 5, 2014

This appears to be caused by my failure to call (projectile-global-mode). This hasn't been a problem before, but I did upgrade to Emacs 24 and upgrade all my packages, so that probably affected things.

@rpdillon rpdillon closed this as completed Nov 5, 2014
@bbatsov
Copy link
Owner

bbatsov commented Nov 5, 2014

Yes, this variable is initialized when projectile-mode gets started - otherwise it will be nil (the root of your problem). I didn't imagine anyone would be using projectile without projectile-mode, so I guess there's some room for improvement.

@rpdillon
Copy link
Author

rpdillon commented Nov 5, 2014

FWIW, I use projectile with helm, and I have never thought of either as a "mode" per se, since I use both everywhere for everything. I went back and read the documentation and found that I wasn't initializing it properly. Your code and documentation is great -- I think this was simply my mistake.

@cjauvin
Copy link

cjauvin commented Jul 10, 2015

I don't know much about the projectile internals, but I've been bit by this "problem": I was using helm-projectile and everything was working great, except that newly visited projects never got added to the list/cache (and no .emacs.d/projectile-bookmarks.eld was ever created). I eventually caught the hash-table-p error, googled it, and stumbled here, so perhaps my experience could be useful to some: (projectile-global-mode) indeed solves this problem.

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

No branches or pull requests

4 participants