# Using polyglossia inside a class creates error when compiling with make4ht

When I set polyglossia as a required package in my class, the following error arises when compiling with make4ht:

[ERROR]   htlatex: Compilation errors in the htlatex run
[ERROR]   htlatex: Filename     Line    Message
[ERROR]   htlatex: /usr/share/texlive/texmf-dist/tex/generic/tex4ht/fontspec-xetex.4ht  23       Undefined control sequence.


In the .log is written the following error message:

)) (/usr/share/texlive/texmf-dist/tex/generic/tex4ht/fontspec-xetex.4ht
version 2021-09-28-22:56
! Undefined control sequence.
<argument> \fontspec_ht_scripts
l.23 ...{\typeout{use block #1}\xeuniuseblock{#1}}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., \hobx'), type I' and the correct
spelling (e.g., I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


Here are the example class:

\ProvidesClass{myclass}[2021/10/23]
\ProcessOptions\relax
\ExecuteOptions{}
\RequirePackage{polyglossia}


and a the .texfile:

\documentclass{myclass}
%\usepackage{polyglossia}
\begin{document}
test
\end{document}


Note that, by loading the polyglossia inside the .tex file, no error is generated.

• I don't get any error for these test files, which is strange, because I experienced similar issues with your class few months ago. It is possible that it was fixed by the make4ht update, as it now loads .4ht files in classes. Do you have the latest make4ht update installed? Oct 26, 2021 at 20:36
• I've also tried with make4ht version v0.3j from CTAN.
– LEo
Oct 27, 2021 at 12:22
• and what is the exact command you use? I've tried both -l and -x options and they seem to work. Oct 27, 2021 at 13:02
• Using the -x option. Although there are those error messages, the html is generated. Using the -l option, the messages are gone but still got this message: attempt to call a nil value (field 'exit_status').
– LEo
Oct 27, 2021 at 13:35
• Ah, if you get exit_status error, then you may have older version of make4ht` installed somewhere on your system. Or some other issue with the installation. I had to deal with this issue few months ago, but it should be fixed now. Oct 27, 2021 at 17:04