I am migrating my existing Hugo website from GitHub Pages to Netlify - the "killer" feature I am really interested into is the CMS add-on provided by Netlify.
After a bit of trial and error, following up the tutorials, I was able to get everything up and running at www.lpalmieri.com - but I can't log into the Admin panel.
If I go to the admin page ( www.lpalmieri.com/admin ) and I enter any kind of credentials nothing happens when I click on the login button - using Google Chrome v68.0.3440.106 I can read the following error in the console log:
Uncaught TypeError: Cannot read property 'login' of undefined
at e (AuthenticationPage.js:129)
at Object.<anonymous> (react-dom.production.min.js:15)
at Object.invokeGuardedCallback (react-dom.production.min.js:16)
at Object.invokeGuardedCallbackAndCatchFirstError (react-dom.production.min.js:16)
at C (react-dom.production.min.js:20)
at I (react-dom.production.min.js:22)
at N (react-dom.production.min.js:22)
at P (react-dom.production.min.js:21)
at j (react-dom.production.min.js:24)
at F (react-dom.production.min.js:24)
CMS configuration
config.yml:
backend:
name: git-gateway
repo: LukeMathWalker/website
branch: master # Branch to update (optional; defaults to master)
publish_mode: editorial_workflow
media_folder: "static/image/uploads" # Media files will be stored in the repo under images/uploads
public_folder: "/images/uploads"
collections:
- name: "blog" # Used in routes, e.g., /admin/collections/blog
label: "Blog" # Used in the UI
folder: "content/posts" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- {label: "Title", name: "title", widget: "string"}
- {label: "Publish Date", name: "date", widget: "datetime"}
- {label: "Draft", name: "draft", widget: "boolean"}
- {label: "Slug", name: "slug", widget: "hidden"}
- {label: "Tags", name: "tags", widget: "list"}
- {label: "Categories", name: "categories", widget: "list"}
- {label: "Body", name: "body", widget: "markdown"}
Looks like you still need to add the Identity widget to your site -- you can follow the directions here: https://www.netlifycms.org/docs/add-to-your-site/#add-the-netlify-identity-widget
Closing this, but please reach out in our community chat.
Thanks a lot!
I got the same error by using the admin/index.html from the Guide.
Adding the identity-widget.js to the template solved the problem:
<script src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
It's not, it needs to be added to whatever page you're using the CMS on. This is partly because it's useless without also being added to the home page of your website, which the CMS also can't do.
Most helpful comment
Looks like you still need to add the Identity widget to your site -- you can follow the directions here: https://www.netlifycms.org/docs/add-to-your-site/#add-the-netlify-identity-widget