Skip to content

InvariantError when the "ai" feature is only allowed on some fields on a page #165

Description

@JNaftali

Issue summary

https://reactjs.org/docs/error-decoder.html?invariant=321 when the "ai" feature is present in some but not all draftail editors on a page.

Steps to reproduce

  1. Start a new project with wagtail start myproject and set up wagtail-ai
  2. add a page type with a RichTextField(features=[]) and a streamfield containing a RichTextBlock(features=["ai"])
  3. migrate, create a page with that type
  4. The editor loads fine initially, but adding a RichTextBlock to the streamfield causes draftail to crash

Additional information

No response

Can be reproduced

Not confirmed

Technical details

  • uv run python --version
    Python 3.14.0
  • uv pip list | grep wagtail
    wagtail 7.4.1
    wagtail-ai 3.1.0
  • uv pip list | grep django
    django 5.2.14

Working on this

If you would like to contribute to this issue, follow these steps:

  • Confirm that the issue is reproducible, either on a fresh Wagtail project or the bakerydemo.
  • Once confirmed, view our contributing guidelines, add a comment to the issue once you're ready to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions