Web App Error: Invalid image span

Hi,
I encountered the following Error:

Error: Invalid image span with no points or x/y/width/height: {"start":5,"end":21,"token_start":1,"token_end":1,"label":"current image"}

in t
in Jss(t)
in div
in Unknown
in Jss(Component)
in t
in t
in Jss(t)
in div
in t
in Jss(t)
in Unknown
in t
in Jss(t)
in div
in div
in t
in Jss(t)
in Connect(Jss(t))
in main
in div
in Shortcuts
in t
in n
in Jss(n)
in Connect(Jss(n))
in t
in t
in Connect(t)
in t
in t

This error occurs as soon as I try to mark a text span in the NER block.
My code:

def image_caption_text_align(dataset: str, sourcefile: str):
    """Stream in images and corresponding text.
    """
    nlp = spacy.load("de_core_news_sm")

    stream = JSONL(sourcefile)
    stream = fetch_images(stream)
    stream = add_tokens(nlp, stream)


    blocks = [
        {"view_id": "image"},
        {"view_id": "text_input",
            "field_id": "caption",
            "field_rows": 4,
            "field-autofocus": True},
        {"view_id": "ner_manual"}
    ]
    return {
        "dataset": dataset,
        "stream": stream,
        "view_id": "blocks",
        "config": {"blocks": blocks,
            "lang": nlp.lang,
            "labels": ["current image"]}
    }

The intention behind it would be to create a caption for the image content (which works) and to also mark the text span to which it refers.

Hi! The problem here is that your NER "spans" conflict with the "spans" key used by default by the image interface. So if you want to annotate NER and image spans at the same time, you'll need to choose a different key to store the image spans. You can do this via the "image_manual_spans_key" config setting: https://prodi.gy/docs/api-interfaces#image_manual-settings

For example, setting "image_manual_spans_key": "image_spans" in your config will store the image spans under that key and prevent them from clashing with the spans annotated with the NER interface.

Hi, thank you for Your reply.
I have seen that "image_manual_spans_key" is a config option for "image_manual" only . So if I change the view ID from "image" to "image_manual", this works perfectly fine, thank you.
(Interestingly, however, using the "image_manual" interface without re-assigning the "image_manual_spans_key" does not cause an error per se, but simply ignores/overwrites the NER spans.)

Ah, I think I initially misread your recipe and thought you were using the image_manual UI for your image block and wanted that to be functional as well. If you only need the image block, you should also to be able to just set "spans": [] on the block to override the value of "spans" and not pass it forward to the UI:

{"view_id": "image", "spans": []},

Ah perfect, thank you for your help.