I have run into a problem with the loader running multiple times (4 times on a clean install).
Ideally a loader should only run once per request, right? How do I fix this?
Why is this a problem?
It eats away at resources and load time, and since a lot of requests are async, it results in a very hard environment to debug.
Steps to reproduce:
- Do a fresh install, following this guide, using Typescript:
https://shopify.dev/docs/apps/getting-started/create
-
Launch VSCode and a javascript debug terminal
-
Attach a breakpoint at line 20 (first line of the loader), inside app._index.tsx
The breakpoint is hit 4 times.