Skip to content

🐛 Bug - Unable to edit specific rule in TinaCMS due to unexpected error #2690

Closed

Description

@tiagov8

Requested by: @tiagov8 via YakShaver.ai 🦬
cc: @tiagov8, @Marxoz, @PothieuG, @Freego1783 @Aibono1225 @adamcogan @joshbermanssw @calumjs @jernejk

Hi Team!

  🟥  Watch the video (1 min 27 sec)

  Url from screen share: https://ssw.com.au/rules/admin/#/rules/get-data-to-your-ai

Pain

A user reported that editing a specific rule in Rules V3 (TinaCMS) causes an unexpected error when clicking the pencil/edit icon.

Error
Unexpected Error
We ran into an unexpected error while fetching your content. If after refreshing the issue persists, reach out to us on Discord.

The issue occurs consistently for the "Chewing the Fat" rule, while other rules can still be edited normally. Reloading and hard reloading the page did not resolve the issue. The user also noted a similar issue occurring on the "Do You Know How to Get Your Data to Your AI" rule. This prevents updates from being made to the affected rules.

Extra: After recoding I notived a broken image that needs to be fixed:
https://www.ssw.com.au/rules/get-data-to-your-ai#so-which-should-i-use?

Image

Acceptance Criteria

  1. Users can successfully open the edit view for the affected rules in TinaCMS without receiving an unexpected error.
  2. The "Chewing the Fat" rule can be edited and saved successfully.
  3. The "Do You Know How to Get Your Data to Your AI" rule can be edited and saved successfully.
  4. Editing functionality for other rules continues to work as expected.
  5. If an edit operation fails, the system displays a meaningful and actionable error message.
  6. Broken image is fixed

Reproduce Steps

  1. Navigate to Rules V3 (TinaCMS).
  2. Locate the "Chewing the Fat" rule.
  3. Click the pencil/edit icon for the rule.
  4. Observe that an unexpected error is displayed.
  5. Reload or hard reload the page.
  6. Attempt to edit the rule again and observe the same error.
  7. Navigate to another rule and confirm editing works normally.
  8. Locate the "Do You Know How to Get Your Data to Your AI" rule.
  9. Click the pencil/edit icon and observe the same unexpected error.

Screenshot

Screenshot
Figure: Unexpected error editing rule

Activity

  1. self-assigned this
    on Jul 30, 2026
  2. removed their assignment
    on Jul 30, 2026
  3. github-actions commented on Jul 30, 2026

    @github-actions
    Contributor

    🔍 Research Findings

    Thanks for the detailed report. I've investigated the codebase and here are my findings.


    Summary

    The TinaCMS "unexpected error while fetching your content" is almost certainly caused by invalid or unsupported content in the MDX files for those two specific rules in the SSW.Rules.Content repo — not in the SSW.Rules frontend code.


    Relevant Files (this repo)

    File Role
    tina/collection/rule.tsx TinaCMS schema definition for rules
    tina/config.tsx TinaCMS global config (branch, search, etc.)
    components/embeds/index.ts Registered embed templates
    components/embeds/imageEmbed.tsx Image embed (includes normalizeSrc logic)

    Registered TinaCMS Embed Templates

    Only these five components are registered in the TinaCMS schema (components/embeds/index.ts):

    export const embedTemplates: Template[] = [
      endIntroTemplate,
      emailEmbedTemplate,
      imageEmbedTemplate,
      boxEmbedTemplate,
      youtubeEmbedTemplate,
    ];

    If either rule's MDX body uses any other JSX component (e.g. a <Figure> standalone, <TwitterEmbed>, <Iframe>, or any previously-supported but now-removed component), TinaCMS will fail with exactly this kind of "unexpected error" because it can't parse the unknown component against the schema.


    Potential Causes

    1. Unregistered MDX component — The rule uses a JSX component in its body that is not in embedTemplates. TinaCMS can't deserialise it → fetch error.
    2. Invalid/corrupted frontmatter — A YAML parsing issue in the rule's frontmatter would cause TinaCMS's GraphQL API to fail when fetching that document.
    3. Schema mismatch after a recent change — If a field was renamed or removed from the TinaCMS schema but still exists in the MDX frontmatter, the API would return an error.
    4. File too large — TinaCMS has size/timeout limits; unusually large rules can occasionally hit this.

    Broken Image (Acceptance Criteria #6)

    The broken image at (www.ssw.com.au/redacted) is also a **content issue** — the srcvalue inside an(imageEmbed)(or raw(img)`) in the MDX file is pointing to a missing/deleted image URL.

    Note: imageEmbed.tsx has a normalizeSrc function that strips a duplicated `(assets.tina.io/redacted) prefix — a double-URL is one known pattern that can result in a broken image.


    Recommended Next Steps (for a developer)

    1. Open the affected MDX files in SSW.Rules.Content:

      • rules/chewing-the-fat/rule.mdx
      • rules/get-data-to-your-ai/rule.mdx
    2. Check the body for any JSX components that are NOT in the list above (endIntro, emailEmbed, imageEmbed, boxEmbed, youtubeEmbed).

    3. Check the frontmatter for any malformed YAML or fields that don't match the current TinaCMS schema in tina/collection/rule.tsx.

    4. Check the broken image src — look for a double URL, a deleted blob URL, or a GitHub attachment URL that's no longer accessible.

    5. If a previously-supported component was removed and is still used in these rules, it will need to be either:

      • Re-added to the TinaCMS schema (in components/embeds/ and index.ts), or
      • Replaced with a supported alternative in the content MDX.

    Confidence: Low — the root cause requires inspecting the actual content files in SSW.Rules.Content, which is a separate repository. The SSW.Rules frontend code appears correct.

    Note

    🔒 Integrity filter blocked 2 items

    The following items were blocked because they don't meet the GitHub integrity level.

    • #2249 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
    • #2368 search_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".

    To allow these resources, lower min-integrity in your GitHub frontmatter:

    tools:
      github:
        min-integrity: approved  # merged | approved | unapproved | none

    Generated by Issue Triage for issue #2690 · ● 462.9K · ◷

  4. tiagov8 commented on Jul 30, 2026

    @tiagov8
    MemberAuthor

    Update: I found there was a change to the rule URL which caused the mess up

    the latest is:
    https://www.ssw.com.au/rules/feed-data-to-ai

    ...but the Form was still linking to:
    https://www.ssw.com.au/rules/get-data-to-your-ai

    --

    ✅ Done - I fixed the link in the form: 2026-07-31 - From RAG to Riches (long context) - Chewing the Fat 📈 – Fill out form

    --

    PENDING - Still need to figure out how and why the old URL is still live

  5. Aibono1225 commented on Jul 31, 2026

    @Aibono1225
    Contributor

    PENDING - Still need to figure out how and why the old URL is still live

    RESOLVED - Found out why the old URL is still live.
    The old link still works after the rename because redirects.json only gets updated once a day. So the old link will keep working until the next scheduled deployment

    This is a known limitation that could be improved, PBI: #2513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions