"This theme is invalid and cannot be activated" - but errors not displayed

I’m doing some local theme development on a local demo instance of Ghost. When I try to upload the theme to my hosted instance, I get this error, but no detailed info where others with this same issue will have some handlebars mismatch or build issue displayed.

  • The theme is a fork of the Dawn theme
  • I’m running Node v18.19.0
  • on OSX, and Firefox browser.
  • Ghost doctor returns everything ok

Any ideas on what I might be able to do to troubleshoot this?

Are you uploading a zip file? Is it a zip of the folder that contains the root of the theme? If you extract the contents of the .zip file, do you see all the files you’d expect to have in the theme? (Try comparing to a new download of the dawn theme’s .zip file.)

You might run gscan on the zip locally before uploading to see if you get anything more informative, but I’m guessing that you’re getting this error because you are uploading something that Ghost doesn’t recognize as a theme at all, rather than something that’s basically theme-structured but with a syntax error somewhere.

Thanks Cathy - yeah now that I inspect a fresh download of Dawn from github, I am realizing that there is a large node_modules folder in my local development structure that is not in the Github. It’s like 150mb and the download is ~.5mb. This must be it.

Does that folder automatically show up in local ghost development? Afaik it’s been there since I installed the theme (which I did through the locally hosted Ghost UI). I don’t know if I can delete that folder either, because the Dawn theme also imports various partials from the shared theme material subdirectory there.

Sounds like you installed with npm install. So, you can build the theme with ‘gulp build’, which will construct the zip file for you. :)

Got it, thanks. I also had to run npm run zip for it to actually compile, but it worked then. Appreciate it Cathy!

Apologies. I meant gulp zip! :) Glad you figured it out, and thanks for the correction! :)

1 Like