syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.64k stars 4.89k forks source link

Cannot load `org-roam-ui` in Spacemacs with error ⛔ "Error (use-package): Cannot load org-roam-ui" #16525

Closed Enrico68 closed 2 weeks ago

Enrico68 commented 3 weeks ago

Issue Description

Description of the Problem

I am encountering an issue where I am unable to load the org-roam-ui package in Spacemacs. I have activated the necessary Org-related packages in my .spacemacs configuration file, but when I try to call the use-package for org-roam-ui, I receive an error message.

Steps to Reproduce

  1. Activate the Org-related packages in .spacemacsl:
    (org :variables
        org-enable-transclusion-support t
        org-enable-org-roam-ui t
        org-enable-org-journal-support t)
  2. Add the use-package configuration for org-roam-ui in .init.el as follows:
    (use-package org-roam-ui
     :after org-roam ;; or :after org
     ;; normally we recommend hooking orui after org-roam, but since org-roam does not have
     ;; a hookable mode anymore, you're advised to pick something yourself
     ;; if you don't care about startup time, use
     ;; :hook (after-init . org-roam-ui-mode)
     :config
     (setq org-roam-ui-sync-theme t
           org-roam-ui-follow t
           org-roam-ui-update-on-save t
           org-roam-ui-open-on-start t))
  3. Restart Spacemacs or reload the configuration.
  4. Observe the error message: ⛔ "Error (use-package): Cannot load org-roam-ui".

Expected Behavior

The org-roam-ui package should load successfully without any errors, allowing its functionalities to be used as specified in the configuration.

Observed Behavior

Instead, the following error message is displayed:

⛔ Error (use-package): Cannot load org-roam-ui

Additional Information

Request for Help

Please advise on how I may resolve this error and correctly load the org-roam-ui package in my Spacemacs setup.

smile13241324 commented 3 weeks ago

You should never edit your init.el at least in Spacemacs. The issue you are encountering is that the package is most likely not yet loaded via the layer system therefore use-package cannot load it.

Instead you should edit your dotfile and add your settings to your user-config

In your case it would look like:

(defun dotspacemacs/user-config ()
  "Configuration for user code:
This function is called at the very end of Spacemacs startup, after layer
configuration.
Put your configuration code here, except for variables that should be set
before packages are loaded."

  (with-eval-after-load 'org-roam
    (setq org-roam-ui-sync-theme t
          org-roam-ui-follow t
          org-roam-ui-update-on-save t
          org-roam-ui-open-on-start t)
    ))
smile13241324 commented 3 weeks ago

Please let me know if this solved your issue. Btw, I have another issue with org roam and would be happy for an example file, would you mind providing one?

I am rather working with GTD to be honest.