I'm having a crash with XeLaTeX on any file that uses the fontspec package. I get this as the error:

! LaTeX error: "kernel/invalid-variant"
! Variant form 'e' invalid for base form '\tl_if_empty_p:n'.

This is odd, because I just came back to doing some TeX work after a month or two, and as far as I know, nothing has changed at all since the last time it worked. I just updated MiKTeX and that hasn't solved the problem.

Minimal failing example:






If I remove the \usepackage and \setmainfont commands, it works fine.

I know very little about the internals of TeX programs, so I am completely at a loss here. What is going on?

  • 3
    Update as user and as admin. Feb 5, 2019 at 23:13
  • @UlrikeFischer I tried to update it from the miktex-update.exe files, and it gave a bunch of errors and now seems to have halfway uninstalled itself - those exe files no longer exist, and several other files such as TeXworks and the uninstaller copystart_admin.exe. I don't even know how to finish uninstalling it to reinstall it, as the file that the Windows uninstaller calls is now gone.
    – Sjiveru
    Feb 5, 2019 at 23:32
  • Search for the MiKTeX console. Feb 5, 2019 at 23:34
  • @UlrikeFischer Oh, there's the uninstall option.
    – Sjiveru
    Feb 5, 2019 at 23:35
  • @UlrikeFischer Something is horribly broken in my system - reinstalling from scratch seems to finish, then throws an error that just says this: "Sorry, but "MiKTeX Configuration Utility" did not succeed for the following reason: Option --admin only makes sense for a shared MiKTeX setup. Error: The executed process did not succeed." Log file says " info: fileName="C:\Program Files\MiKTeX 2.9\miktex\bin\x64\initexmf.exe", exitCode="1" "
    – Sjiveru
    Feb 5, 2019 at 23:50

1 Answer 1


I got the same problem. After reading comments above, tried updating the MikTeX both in user and admin modes but failed.

Later on, I search for l3kernel (inside MikTeX Console >> Packages) and found that it wasn't installed at all. After installing l3kernel and its packing via MikTeX Console >> Packages, everything is working as earlier!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .