Does anybody know how to fix this problem with mhchem package?
! Undefined control sequence.
<argument> \l__mhchem_cg_isScript_bool
Recently I've found this part of mhchem.sty code:
\cs_new_protected:Npn \__mhchem_output_escapeFromTextToItalicMath:n #1
{
\ensuremath
{
\mhchem@hook@beforeItalicMath
\bool_if:NT \l__mhchem_cg_isScript_bool
{
\medmuskip=0mu
\thinmuskip=0mu
\thickmuskip=0mu
}
#1
}
}
It seems to me problem is connected with \bool_if:NT \l__mhchem_cg_isScript_bool condition which can be wrong with newest expl3 package. The same bug has successfully been solved in siunitx package.
Win 10, MikTeX 2.9.6236, up-to-date

code\bool_new:N \l__mhchem_cg_isScript \cs_new_protected:Npn __mhchem_output_escapeFromTextToItalicMath:n #1 { \ensuremath { \mhchem@hook@beforeItalicMath \bool_lazy_any:nT \l__mhchem_cg_isScript { \medmuskip=0mu \thinmuskip=0mu \thickmuskip=0mu } #1 } } – Alexey Jul 24 '17 at 11:44\thinmuskipto zero is wrong. – egreg Jul 24 '17 at 11:48\bool_if:NTcode was added in version 4.04, but not accompanied by a definition of the boolean variable, nor with any way to toggle it. Hence it is completely useless. – egreg Jul 24 '17 at 11:57\thinmuskip=0muis not mine, but your suggestion about declaration is right. I've made it like\bool_new:N \l__mhchem_cg_isScript– Alexey Jul 24 '17 at 11:58\bool_new:N \l__mhchem_cg_isScript_bool. – Bruno Le Floch Jul 24 '17 at 13:26