Tex presents no errors.
Output
Calling Sub2.tex.
Sub2.tex entered.
Calling Sub1.tex.
Sub1.tex entered.
Sub1.tex completed.
Directory structure
./main.tex
./Sub2.tex
./Sub1.tex
main.tex
\documentclass{article}
\usepackage{expl3}
\usepackage{subfiles}
\begin{document}
Calling Sub2.tex.
\subfile{./Sub2.tex}
Sub2.tex exited into main.tex.
Calling Sub2.tex.
\subfile{./Sub1.tex}
main.tex completed.
\end{document}
Sub1.tex
\documentclass[./main.tex]{subfiles}
\begin{document}
Sub1.tex entered.
Sub1.tex completed.
\end{document}
Sub2.tex
\documentclass[./main.tex]{subfiles}
\begin{document}
Sub2.tex entered.
Calling Sub1.tex.
\subfile{./Sub1.tex}
Sub2.tex completed.
\end{document}
\documentclass[./main.tex]{subfiles}let's me assume that you let it search in a folder one ore more levels up in your directory structure (where there is no such file). Does deleting the./in\documentclass[./main.tex]{subfiles}solve your problem? Otherwise, if both subfiles are one level under your main file, try../instead of./(please note the two dots). – Lukas Jan 11 '22 at 07:22! LaTeX Error: There's no line here to end.please provide an error free test file, and show the log you get, so we can compare and debug. – David Carlisle Jan 11 '22 at 07:57main.logand check the version of LaTeX and subfiles. My guess is that your TeX distribution is outdated and you are using a LaTeX format predating Oktober 2020. Maybe it is also the other way around, but it is almost surely a version mismatch / outdated version problem. My log file saysLaTeX2e <2021-06-01> patch level 1andsubfiles 2020/11/14 v2.2. So the solution is to upgrade your TeX distribution. How this has to be done depends on your distribution (MiKTeX, TeXlive, ...) – gernot Jan 11 '22 at 20:44./main.tex(a single dot) denotesmain.texin the current directory.../main.tex(two dots) denotesmain.texone level up from the current directory. – Ulrich Diez Jan 11 '22 at 22:22