After updating to magit 20190517.1750 from ELPA, I've got this warning
slot-missing: Invalid slot name: "#<transient-prefix transient-prefix>", :incompatible
which breaks a lot of magit functionality. Does somebody know a fix or a quick workaround?
Update the transient
package and restart Emacs.
The incompatible
object slot was added fairly recently to the transient-prefix
class. I do not use package.el
myself, but believe that normally it updates all packages at once but also supports just updating one package. Maybe you did the latter.
Updating a package does not unload the previously loaded version and then load the new version. It is even possible to end up with half of the old version and half of the new version being loaded. E.g. if the library foo-bar
is already loaded before you update the package foo
and then you do something that causes library foo-baz
to be loaded, then the foo-bar
from the previous version is loaded alongside the foo-baz
of the new version.
So maybe you actually did update transient
at the same time at magit
, but because transient
was already loaded and (parts of) magit
were not you ended up with incompatible versions installed.
You should always restart Emacs after updating packages. You can also forgo doing so (it often works or you won't notice the issues), but before you report an issue you must restart to test whether that "fixes" the issue.
If after doing all that you still get this error, then something™ is trying to use transient
before that has been loaded. Explicitly (require 'transient)
near the beginning of your init file might be good enough as a workaround. But of course it would be better to figure out the identity of something™.
So the solutions seem to be as @tarsius suggested to (require 'transient)
package early on in the init.el and to reinstall the magit
package from ELPA. Now everything seem to work again.