Skip to main content
5 of 7
added 1509 characters in body
Swarnendu Biswas
  • 1.5k
  • 1
  • 12
  • 25

Problem with loading packages with Emacs 28

I have installed Emacs 28 with snap from https://snapcraft.io/install/emacs-28. My init.el is configured using use-package. However, I get the following errors when I try to install and load custom packages with use-package. Suppose I have the following.

(use-package async
  :functions async-bytecomp-package-mode
  :commands async-bytecomp-package-mode
  :init (async-bytecomp-package-mode 1))

This is the error I get.

Warning (initialization): An error occurred while loading `/home/swarnendu/.emacs.d/init.el':

File is missing: Cannot open load file, No such file or directory, ../../../../.emacs.d/elpa/async-20210823.528/async-bytecomp

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace. Disable showing Disable logging

This happens regularly for several packages I have added. The package installations continue when I disable the problematic packages with :disabled t, but the problem then arises for some other package.

Warning (initialization): An error occurred while loading `/home/swarnendu/.emacs.d/init.el':

File is missing: Cannot open load file, No such file or directory, ../../../../.emacs.d/elpa/anzu-20211002.2255/anzu

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace. Disable showing Disable logging

This is what I get with /snap/bin/emacs -nw --debug-init. Note that the files .emacs.d/elpa/anzu-20211002.2255/anzu* exist.

swarnendu:~$
Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory"
"../../../../.emacs.d/elpa/anzu-20211002.2255/anzu")
  (global-anzu-mode 1)
  load-with-code-conversion("/home/swarnendu/.emacs.d/init.el" "/home/swarnendu/.emacs.d/init.el" t t)
  load("/home/swarnendu/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0xf4340e0e34e19f6>) #f(compiled-function () #<bytecode
-0x1f3c686ddc0cd5f5>) t)
  command-line()
  normal-top-level()

This problem arises on multiple systems with Emacs 28, but the same config works with Emacs 27.

UPDATE: Dec 10, 2021

Emacs loads if I comment all use-package lines like :init (global-anzu-mode 1) and :hook (ibuffer . ibuffer-projectile-set-filter-groups). However, the error appears when I try to enable the modes manually.

UPDATE: Dec 29, 2021

The issue appears with Emacs 28 pretest built from source, but I can run Doom Emacs successfully. My guess is that the path ../../../../.emacs.d/elpa/anzu-20211002.2255/anzu is wrong, it possibly has an extra ... I can see the entry in package-quickstart.el. How can I track where the path is constructed?

Here are a few more symptoms I have found. The following declaration works in both Emacs 27 and 28, but the one below only works with Emacs 27 but does not work with Emacs 28.

(use-package doom-modeline
  ;; Requires the fonts included with `all-the-icons', run `M-x all-the-icons-install-fonts'
  :ensure all-the-icons
  :ensure doom-modeline
  :if (eq sb/modeline-theme 'doom-modeline)
  :commands doom-modeline-mode
  :demand t
  :init
  (setq doom-modeline-buffer-encoding nil
        doom-modeline-checker-simple-format nil
        doom-modeline-indent-info nil
        doom-modeline-lsp nil
        doom-modeline-minor-modes t
        ;; Reduce space on the modeline
        doom-modeline-buffer-file-name-style 'file-name)
        :config
  (doom-modeline-mode 1))

(use-package doom-modeline
  ;; Requires the fonts included with `all-the-icons', run `M-x all-the-icons-install-fonts'
  :ensure all-the-icons
  :ensure doom-modeline
  :if (eq sb/modeline-theme 'doom-modeline)
  :commands doom-modeline-mode
  :init
  (setq doom-modeline-buffer-encoding nil
        doom-modeline-checker-simple-format nil
        doom-modeline-indent-info nil
        doom-modeline-lsp nil
        doom-modeline-minor-modes t
        ;; Reduce space on the modeline
        doom-modeline-buffer-file-name-style 'file-name)
  (doom-modeline-mode 1))
Swarnendu Biswas
  • 1.5k
  • 1
  • 12
  • 25