In a nutshell, the JSS app's config patch (usually deployed to
\App_Config\Include\zzz\my-jss-app.config) is resolved before SXA sites.
When the SXA module is installed in Sitecore, you get a bunch of new configs. Of particular interest for this issue is this patch file that says where to place the SXA sites:
<site name="exm" resolve="after" />
<site name="website" resolve="after" />
This patch file is saying to place the SXA sites before the default
<site>. If you check out
/sitecore/admin/showconfig.aspx on your website, you'll see that SXA sites are not rendered in the final config under the
<sites> section. So at the point of resolving the SXA sites, your JSS app config has already been resolved and the SXA sites are going to be put behind it, between the JSS app and the default
In order to fix this I needed to create a new patch file adding my JSS site to this of
<site>s to ensure the SXA sites are placed before it (your JSS root site):
<site name="my-jss-app" resolve="after" patch:after="site[@name='website']" />
By doing this, in the SXA Site Manager, you'll see your SXA sites are now listed before your root JSS site.