I have followed the instructions here to write a mwe:
\documentclass{standalone}
%\documentclass{beamer}
\usepackage[no-math]{fontspec}
\setmainfont[Ligatures=TeX]{Chalkduster}
\usepackage[defaultmathsizes]{mathastext}
\begin{document}
Is this what you expected?
\end{document}
It works well when compiled using xelatex:
Whenever I switch the comment between the documentclass lines, this is what I get:

What am I missing?
Thanks in advance.