Remix Admin App runs loader multiple times

Remix Admin App runs loader multiple times

JesperHoff
Shopify Partner
2 0 3

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:

 

1. Do a fresh install, following this guide, using Typescript:

https://shopify.dev/docs/apps/getting-started/create

 

2. Launch VSCode and a javascript debug terminal

 

3. Attach a breakpoint at line 20 (first line of the loader), inside app._index.tsx

 

The breakpoint is hit 4 times.

Reply 1 (1)

Jinspe
Shopify Partner
1 0 0

I've got the same problem and posted it on GitHub too:
https://github.com/Shopify/shopify-app-template-remix/issues/474.

If you have any ideas on how to fix this, I'd really appreciate it. Thanks!