This question already has an answer here:

Im trying to make my own package and spacemacs layer.

I would like to get the minimal package working so currently it is just one line of code in a file named mypackage/mypackage.el with the content:

(defun mypackage-printshit () (print "SHIT"))

The layer looks as follows:

(defconst mylayer-packages
  '((mypackage :location local)))
(defun mylayer/init-mypackage ()
  (use-package mypackage
    :defer t
    :init
    (progn
      (spacemacs/set-leader-keys 'mypackage
        "aR" 'mypackage-printshit))))

However this fails to load with the following error:

Error (use-package): mypackage/:init: Wrong type argument: integer-or-marker-p, mypackage

My questions are what can I change to fix the problem and how can I debug this to find the error next time?

Link to code repo: link

marked as duplicate by Gilles Aug 21 at 8:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.