I’m sorry to hear you’re having such a tough time setting it up.
Discourse is not smart enough to crawl a SPA so this sounds the fishiest to me. Can you try and reproduce with a site that contains static content?
It is impossible for us to support every bespoke install, so I recommend you try simplifying your stack further until it works, then add on pieces from there.