Skip to content
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

Changing writing locale cause uncaught type error #6307

Open
alvinsay opened this issue Mar 18, 2022 · 0 comments
Open

Changing writing locale cause uncaught type error #6307

alvinsay opened this issue Mar 18, 2022 · 0 comments
Labels
area: i18n good first issue type: bug code to address defects in shipped code

Comments

@alvinsay
Copy link

alvinsay commented Mar 18, 2022

When writing a new post, changing locale will cause an uncaught type error and the editing form of the post content isn't show up.

To Reproduce

  1. Setup Netify CMS with i18n enabled.
  2. Click New button in the index page.
  3. Change writing locale dropdown from Writing in EN to another locale, for example, Writing in FR
  4. The editing form will disappear, and you will see an uncaught type error in the debug console.

Expected behavior

  • No error will be thrown.
  • The editing form won't disappear after changing the writing locale.

Screenshots

netify-cms-i18n

Applicable Versions:

  • Netlify CMS version: 2.*.*
  • Git provider: Self-hosted Gitlab
  • OS: MacOS
  • Browser version: chrome 99

CMS configuration

config.yaml

backend:
  name: gitlab
  repo: alvin/static-api-testbed # Path to your GitLab repository
  auth_type: pkce # Required for pkce
  app_id: #masked
  api_root: #masked
  base_url: #masked
  auth_endpoint: oauth/authorize
publish_mode: editorial_workflow
media_folder: "static/images/uploads"
public_folder: "static/images/uploads"
i18n:
  locales:
    - en
    - fr
  structure: "multiple_files"
  default_locale: en
collections:
  - name: "announcement" # Used in routes, e.g., /admin/collections/blog
    label: "Announcement" # Used in the UI
    i18n: true
    folder: "content/announcement" # 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: "Featured Image", name: "thumbnail", widget: "image"}
      - {label: "Rating (scale of 1-5)", name: "rating", widget: "number"}
      - {label: "Body", name: "body", widget: "markdown"}

index.html

<!doctype html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Content Manager</title>
</head>

<body>
    <!-- Include the script that builds the page and powers Netlify CMS -->
    <script src="https://unpkg.com/netlify-cms@^2.10.187/dist/netlify-cms.js"></script>
</body>

</html>

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: i18n good first issue type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants