The following code with compiles with a warning on Windows 10 using LuaLatex although produces a readable document.
\documentclass{article}
\usepackage{babel}
\babelprovide[main, import]{thai}
\babelfont{rm}{FreeSerif}
\begin{document}
สวัสดี
\end{document}
Warning:
font2.tex|| Package fontspec Warning: Language 'Thai' not available for font 'FreeSerif' with script 'Thai'.
The following triggers an extra warning and produces a document with the Thai text missing altogether.
\documentclass{article}
\usepackage[english,thai]{babel}
\babelprovide[import]{thai}
\babelfont{rm}{FreeSerif}
\begin{document}
Hello.
\begin{otherlanguage}{thai}
สวัสดี
\end{otherlanguage}
\end{document}
Warnings:
font_problem.tex|| Package fontspec Warning: Language 'Thai' not available for font 'FreeSerif' with script 'Thai'.
font_problem.tex|| LaTeX Font Warning: Font shape `LTH/FreeSerif(0)/m/n' undefined using `LTH/norasi/m/n' instead on input line 3.
What is causing this and how can I solve it? FreeSerif does include Thai glyphs and the first code is taken straight from the Latex WikiBooks's example.