Confused with shopify.web.toml Background File

Confused with shopify.web.toml Background File

Shopify Partner
2 0 1

I am using Shopify's recommended remix app.
In the root directory I have a shopify.web.toml file (the default)

name = "app"
roles = ["frontend", "backend"]
webhooks_path = "/webhooks"

dev = "npm exec remix dev"

http_paths = ["/ping"]

When i run npm run dev this works perfectly and I can access the app in my test store.

Now I want to add a background process using the "background" role talked about in this link:


I made a folder in the root directory and I have a js file and another shopify.web.toml file with this in it


name = "pubsub"
roles = ["background"]

dev = "node pubsub.js"



When I run npm run dev in the root directory, both processes startup (i can see output from each process in the terminal) however when I try to access the app within my test shop it won't load and I get this error:
"Error forwarding web request: AggregateError"

I'm not entirely sure why and I don't know how making a background process with another shopify.web.toml is causing the error when it works when I don't have the second process running.

Replies 0 (0)