-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read properties of undefined (reading 'path') #5815
Comments
Hello @dara-icf . Can you provide the steps of actions that lead to the |
This happened to me. Fresh install. I couldn't upload content or media files. I tried uploading an image to isolate the issue And looking at the error messages I found that Netlify CMS was trying to save in my repository in the https://stevenmortimer.com/5-steps-to-change-github-default-branch-from-master-to-main/ I also triggered a new deploy to see if it was doing the "checkout" correctly: |
@gangsthub : Do you mean that this error stems from Netlify CMS trying to push content to a But I'm not sure if that is the sole cause of this issue. Last time I encountered this problem, Netlify CMS will display this error: "API_ERROR: Branch not found". Do you mind providing a step by step and your config file? |
I'll try to come up with a repro guide, but I can't promise anything. The only thing I know is that it got fixed after I did the branches change. 🙏🏽 |
@gangsthub : The issue will always get resolved if you specify the branch name in the config. Actually, it only manifests when you don't configure branch name, which I think is the case with many newly-initiated project with Netlify CMS. What happens under the hood is that Netlify CMS will assume that your default branch is So, that's the gist of the problem 😓. |
Yes! I did figure this out. Thanks. The line to specify branch was commented out.
…--
Dara Pressley
From: Trang Le ***@***.***>
Date: Monday, September 27, 2021 at 3:33 AM
To: netlify/netlify-cms ***@***.***>
Cc: Pressley, Dara ***@***.***>, Mention ***@***.***>
Subject: Re: [netlify/netlify-cms] TypeError: Cannot read properties of undefined (reading 'path') (#5815)
@gangsthub<https://github.com/gangsthub> : The issue will always get resolved if you specify the branch name in the config. Actually, it only manifests when you don't configure branch name, which I think is the case with many newly-initiated project with Netlify CMS.
What happens under the hood is that Netlify CMS will assume that your default branch is master, which is no longer the case with all the major Git host. Then, when it tried to push content to master branch, it will get hit with an 404 (IIRC) error because master doesn't exist in many repos.
So, that's the gist of the problem 😓.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#5815 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMVBHGGYLRIXLL6DO6ZTZRTUEBCAJANCNFSM5ED2VGZQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
@dara-icf So is it okay to close this issue now? |
Thanks, @bytrangle! I forgot about that branch option in the configuration! |
@gangsthub Many of us got tripped by that when first setting up Netlify CMS :). |
Yes, but know that that was figured out… I continue to amazed at how easy Netlify CMS is!
…--
Dara Pressley
From: Trang Le ***@***.***>
Date: Tuesday, September 28, 2021 at 9:23 AM
To: netlify/netlify-cms ***@***.***>
Cc: Pressley, Dara ***@***.***>, Mention ***@***.***>
Subject: Re: [netlify/netlify-cms] TypeError: Cannot read properties of undefined (reading 'path') (#5815)
@gangsthub<https://github.com/gangsthub> Many of us got tripped by that when first setting up Netlify CMS :).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#5815 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMVBHGH6QHCCVHBO56PAPHLUEHTWHANCNFSM5ED2VGZQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Describe the bug
To Reproduce
Expected behavior
Screenshots
Applicable Versions:
netlify-cms@2.10.164
github
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36
CMS configuration
Additional context
The text was updated successfully, but these errors were encountered: