Fail to pass arguments to orbital module of chemmacros when used inside chemfig

While illustrating atomic orbitals for 1,3-butadiene guided by examples in chemmacros' manual, I receive the following error:

Argument of \orbital has an extra }. }

MWE:

\documentclass{article}
\usepackage{chemmacros}
\chemsetup{modules = all}
\chemsetup[orbital]{overlay}
\usepackage{chemfig}
\setchemfig{
atom sep = 2.5em
}

\begin{document}

\chemfig{
\orbital{p}
-[:30]\orbital{p}
-[:-30]{\orbital[phase=-]{p}}
-[:30]{\orbital[phase=-]{p}}
}

\end{document}


pdflatex produces the following [incorrect] structure:

The same error occurs for the examples from the manual where optional arguments are passed to \orbital[...]{...} inside \chemfig{...}. I'm using fully updated TeXLive 2018.

Update (2019-10-19)

I tried the above MWE again and it compiles as expected using chemfig v1.41 from TeX Live 2019, so the problem seems to be fixed.

Empirically I found out that putting arguments inside {...} (and not entire \orbital[...]{...} command) solves the problem:

\documentclass{article}
\usepackage{chemmacros}
\chemsetup{modules = all}
\chemsetup[orbital]{overlay}
\usepackage{chemfig}
\setchemfig{
atom sep = 2.5em
}

\begin{document}

\chemfig{
\orbital{p}
-[:30]\orbital{p}
-[:-30]\orbital[{phase=-}]{p}
-[:30]\orbital[{phase=-}]{p}
}

\end{document}


I'm still not sure what caused the former solution to stop working; maybe it has something to do with the recent chemfig update.

• Are you saying that in some older version of chemfig the MWE in your question worked, but now you had to switch the order of {}? Btw. it somehow reminds me this bug tex.stackexchange.com/questions/156547/bug-in-arrow-label Jan 4, 2019 at 16:53
• @pisoir About an year ago I remember using the examples for orbitals from chemmacros's manual and I didn't encounter any issues. Jan 5, 2019 at 2:01