TypeError: Expected "0" to be defined
- Dominant language
- JavaScript
- Stars
- 19.4k
- Forks
- 3.1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
**Describe the bug**
- I followed the instructions on Decap's doc page to connect to my Docusaurus website. Everything was fine at first, but after a while, when I logged in and accessed the admin page, an error message appeared (see the image below).
- I am not sure what the issue is, even though I tried creating a new repo and setting up a separate project, but the same issue occurred.
- The problem happens after a successful login.
**To Reproduce**
- I have tried experimenting with several things like changing the key, OAuth, etc., but it seems to not resolve the issue.
- I built the app on Nextlify and hosted it on GitHub as per the instructions.
- My English is not very good, so I hope you can understand. Thank you in advance.
- If you need anything else, please let me know so I can provide it.
**Expected behavior**
I expect that after logging in, I will be redirected to the Decap CMS interface as usual. This is quite strange, but I encountered this error after it successfully ran on both the local server and the build version for a day
**Screenshots**

**Applicable Versions:**
- Decap CMS version: `decap-cms@3.4.0`
- Git provider: `github`
- Browser version: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36`
**CMS configuration**
```
backend:
name: github
branch: main
repo: nguyenquyynh/doc.web
media_folder: static/img
public_folder: /img/
collections:
- name: Doc (VI)
label: Doc (VI)
label_singular: Doc (VI)
folder: docs
identifier_field: title
extension: md
widget: list
create: true
delete: true
nested:
depth: 100
slug: "{{slug}}"
summary: /{{dirname}}/{{filename}}.{{extension}}
fields:
- name: path
meta: true
required: true
widget: string
label: Path
index_file: index
- name: title
label: Title
widget: string
- name: label
label: Label
widget: string
- name: body
label: Body
widget: markdown
- name: slug
label: Slug
widget: string
required: false
meta:
path:
widget: string
label: Path
index_file: index
publish: true
type: folder_based_collection
sortable_fields:
- commit_date
- title
- commit_author
view_filters: []
view_groups: []
publish_mode: simple
slug:
encoding: unicode
clean_accents: false
sanitize_replacement: "-"
isFetching: false
error: null
```
**Additional context**
Contributor guide
Research direction
Start by reproducing the post-login failure with the supplied Decap CMS 3.4.0 GitHub configuration in Chrome, then trace the admin-page authentication flow. Compare a working and failing setup and inspect the reported TypeError; done means login reliably reaches the CMS interface or the failure has a documented, reproducible cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, javascript
- Domain
- authentication, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100