# Bidi/Memoir error

I have been using this preamble for a few years now and have never had any problems. After the last update of yesterday October 4th, an error related to bidi appears as it is built in memoir but no error if \setotherlanguage{hebrew} is commented. Any suggestions or, better, solutions?

\documentclass[a4paper,
twoside,
openright,
10pt,
final]
{memoir}

\usepackage[]{polyglossia}
\usepackage{microtype}
\usepackage{fontspec}
\usepackage{lipsum}
\setmainlanguage{italian}
\setotherlanguages{french}
%\setotherlanguage{hebrew}
\setstocksize{297mm}{210mm}
\setlrmarginsandblock{27mm}{33mm}{*}
\setulmarginsandblock{27mm}{38mm}{*}
\checkandfixthelayout

\setmainfont{TeX Gyre Bonum}[Scale=1]
\newfontfamily\hebrewfont{TaameyFrankCLM-Medium}[Scale=1,Script=Hebrew]

\begin{document}
\lipsum[1]

%\texthebrew{א ב ג ד ה ו ז ח ט י כ ל מ נ ס ע פ צ ק ר ש ת}

%\begin{hebrew}\texthebrew{א ב ג ד ה ו ז ח ט י כ ל מ נ ס ע פ צ ק ר ש ת}\end{hebrew}

\end{document}

• I can't test now, but bidi is not compatible with the new latex, there is an open issue at the bidi github. We added a fix into the firstaid package to avoid the most problematic error, but it is quite possible that other patches from bidi still fail. Oct 5 '20 at 8:59
• If you are using miktex check if you have firstaid, if not install it and update the format. Oct 5 '20 at 9:04
• I do not have the hebrew font you used but if I change font then your example runs without error, please show the error that you got, from the log file Oct 5 '20 at 9:06
• @Davide Carlisle this is the error message that I get from console ./mwe.tex:25: Extra \endgroup \document -> \endgroup \let \bidi@AtEndPreamble \@firstofone \bidi@endpreambl... l.25 \begin{document} Oct 5 '20 at 9:14
• that should be fixed if you remake the format (the first aid package fixes bidi for that). tlmgr update --all then fmtutil-sys --all Oct 5 '20 at 9:16