Gatsby/netlify CMS login broken

I added myself as a user via Netlify identity (via invite) and then was sent an email to accept the invitation, and the route I was redirected to in the email did NOT include /admin. I (obviously) am on level 0 since I am the site administrator and just want to make sure this works with my Gatsby site. How can I fix this???

Hi Maria! You shouldn’t be redirected to admin to accept the invite, it’s supposed to go to your home page. It’s an auth thing. Guessing you don’t have the identity widget loaded on your home page - doing so will allow the invitation redirect to work.

Thanks Shawn! The problem is, that I don’t know how to load it! I have been trying everything. But then there is the other little problem on build which I mentioned in the gitter channel. my build fails because of the gatsby-plugin-netlify-cms. Specifically because of something to do with sourcemaps. So I technically can’t even add the cms right now anyway. It’s not even for myself that I wouold really want to use it. It’s for clients. But I first wanted to test it on my own site.

Hi @erquhart , I temporarily fixed my source map issue and locally was able to successfully run a build. However, as per your docs on Netlify, I followed the Github and repo approach in config.yml. And I also used Github authentication for login. That way, I actually was able to get into the CMS. Nothing saves locally. Is it supposed to be that way? How does this work? Thanks again for your help!

Hi @erquhart, I still want to figure out git-gateway, because that would be the solution I would need for my clients. Github is a good one for me if I am lazy with my markdown (and if I like it). I would be most happy to work with Netlify to test it out with some guidance (or better docs). I see that it is in beta and thus pretty new.

gatsby-plugin-netlify-cms should be adding the identity widget everywhere for you - what versions do you have for Gatsby, Netlify CMS, and the gatsby/netlifycms plugin?

Hi @erquhart, I just have to commit and push some changes in another branch to remote and then will get back to you about my versions. Thanks!

Hi @erquhart, I have gatsby 2.10.0 (was not able to upgrade further previously because of source-maps/terser issue, and don’t know if I can go beyond possibly 2.11.6 as someone else did purportedlh successfully with the resolutions fix), gatsby-plugin-netlify-cms 4.1.1, and netlify-cms-app 2.9.5. Does that mix pose a problem? With the Github/repo setup, I did manage to push two images into static/assets when I pushed to master, but no posts got published. That’s because I had done that on the netlify-cms feature branch and did not merge it with master. But then why did the images I had added to the posts in that branch did get registered as having been pushed to remote origin (master) from the CMS?Have a feeling that that set up might not work properly anymore?

Also, would I still be able to switch to creating posts with markdown from my editor as I have been doing as an alternative? Or would I have to use the CMS only? In addition, I created my site with the gatsbsy-default-starter and not a gatsby-netlify-cms starter. That should not matter, right?

Thanks so much for all your patience and help!

Hi @erquhart, I finally was able to get the widget for git-gateway to work and to log in to the cms. However, as before with the github configuration in config.yml, I am not able to save any posts and the only thing that gets pushed to master is the image I add to the post. I am not able to save any posts there. And everything is called a blog. I don’t think that is right. it should be blog full of individual posts, right? What am I doing wrong here? Or is it that I am working with an existing blog that is the issue? But it should not be. I’m confused. There is something definitely missing in a big way. Link to my repo: interglobalmedia repo on github. You will notice the push to the repo from the cms and that only the image was successfully added to the static/assets folder associated with the config. And, I had to keep the role in identity blank in order to be able to successfully login. otherwise I was given the message that I did not have sufficient access to login. And afterwards, I could not add the admin role to myself. I know I am missing something.

Ah - your blog posts are each in individual folders. That is literally the next area of focus for us! But we’re not there yet. You can check this issue for details and to get updated when we add support: https://github.com/netlify/netlify-cms/issues/1472

And now I am getting a new issue when trying to push to origin master. The image widget is giving me a hard time! It’s not liking my config for the rest of my site. I think that is what you are referring to? So how is someone with my configuration supposed to add an image to a post? Would a markdown image work instead? Like if I added a link to an image from unsplash, would that work? Everyone needs images to their posts. Please advise. Thanks!

I’ve been trying to implement a fix, but it does not work with my site configuration I don’t think: https://github.com/danielmahon/gatsby-remark-relative-images. Even though it does target this netlify-cms issue.

Hi @erquhart, I did some refactoring (not much was necessary) and now netlify cms is working beautifully. Even my older posts have been imported into the CMS. Woo hoo! A post I had created which did not at first get pushed to remote because of some errors in my site configuration (especially regarding images as we discussed), finally showed up first locally and then remotely when I pushed to origin master. Then I edited it, and then deleted it. And everything worked as expected. I did have to do a few workarounds including npm-force-resolutions re the terser issue and gatsby-plugin-netlify-cms, but it works like a charm. Will be podcasting and writing about this starting later today. Link to repo : https://github.com/interglobalmedia/interglobalmedia Everything is up to date there.

1 Like