true, my understanding is not good at the moment, as it's my first experience with this whole platform and developing my first app. I'm open to read anything that helps. Is there a link to documentation you're referring to?
Is there a way to disable this redirect without introducing app bridge because apparently it just breaks on the very first line(tested by creating a fresh project as well and it throws the same error). Or do I need to include it to fix this issue?
The code crashes as it fails to find an html element with an id 'shopify-app-init'. There's no place where I could find about this thing and ended up deleting it, as it wasn't being used anyways.
You can read some docs here:
App bridge is used by embedded apps to bypass 3rd party cookies via session token auth. It is the tool to generate the token, think of it working like the token generator hardware for logging in to your bank (common in Hong Kong). If you are developing a standalone app, App bridge is not necessary. If I don't remember wrong, App bridge must live under the Shopify portal. Otherwise, it will cause an error on the browser console.
If you're not using it, it won't cause a force redirect.
My experience is limited to App bridge, Django, python. If your error is related to Ruby (like wrong routing), I've no knowledge in this area.
The code crashes as it fails to find an html element with an id 'shopify-app-init'.
Finally, I suggest you better utilize your IDE, just use the find-everywhere feature to find this id. My IDE atom can help me to identify this element without a few seconds.