TypeError: m[(m.length - 1)][0] is undefined on Frontend

I am running into an issue when trying to initiate an annotation session.


Everything on the back-end seems to be okay.

PRODIGY_LOGGING=verbose PRODIGY_ALLOWED_SESSIONS=foo,bar PRODIGY_MYSQL_MAX_LEN=16777215  prodigy rel.manual xxx en_core_web_sm dataset:foo --label foo,bar --wrap

except for potentially this warning on boot.

STREAM: Counting iterator exceeded timeout of 10 seconds after 69 tasks
17:54:10: CORS: initialized with wildcard "*" CORS origins

__  Starting the web server at http://0.0.0.0:8080 ...
Open the app in your browser and start annotating!

For information:

============================== __  Prodigy Stats ==============================

Version          1.11.7    
.... 
Platform         Linux-3.10.0-1160.25.1.el7.x86_64-x86_64-with-glibc2.31
Python Version   3.9.9                         
Database Name    MySQL                         
Database Id      mysql

Are you certain that dataset:foo contains data in the right format for the rel.manual recipe? Is it possible for us to have a single example for that dataset so that we may try to reproduce it locally?

I had the same error with Prodigy 1.11.8. To reproduce it, you can use:

prodigy rel.manual at_ner_rels_manual pt_agenda_ner_rel \
        ./data/schedule_participants.jsonl \
        --wrap \
        --label PERTENCE,LOCALIZACAO \
        --span-label PER,ORG,LOC,PARTIDO,CARGO

Where ./data/schedule_participants.jsonl contains:

{"text":"Participantes:\n- Secretário-Executivo Adjunto do Gabinete de Segurança Institucional, Osmar Lootens Machado; e\n- Assessor Diplomático, Manuel Innocencio de Lacerda Santos Junior.\n"}

The only thing I can't share here is my model pt_agenda_ner_rel. However, if you email me I can send it to you.

Thanks for that example, that helps a lot! I figured giving it a spin with pt_core_news_md by running:

prodigy rel.manual issue-5779 pt_core_news_md examples.jsonl --wrap --label PERTENCE,LOCALIZACAO --span-label PER,ORG,LOC,PARTIDO,CARGO

When I run this command with the example from @vitorbaptista I'm able to reproduce it locally on Prodigy version 1.11.7.

Will try to debug and once I discover something I'll report back.

It seems, on my end, that when I remove the --wrap flag it does work. It also seems that when I select "wrap" from the checkbox afterward that it breaks once again.

@vitorbaptista can you confirm you see the same behavior? I'm diving deeper into why this is happening but if you can confirm the same behavior on your end I can confirm that it's the same issue.

I've found something else too. It seems that your example contains a newline. If you remove it, so that the example looks like this:

{"text":"Participantes:\n- Secretário-Executivo Adjunto do Gabinete de Segurança Institucional, Osmar Lootens Machado; e\n- Assessor Diplomático, Manuel Innocencio de Lacerda Santos Junior."}

Then it all seems to work again. Could you confirm that removing the \n works?