Re: Why does the application URL change every time I run npm run dev on Shopify?

Why does the application URL change every time I run npm run dev on Shopify?

ebrown381
Shopify Partner
1 0 4

I am having an issue where I try and run "npm run dev" and it tells me the callback urls need to be changed to the values presented, then run "npm run shopify app config push" which I do.

When I run the command, however, I get the error "Command no longer supported" and instead tells me to run "npm run shopify app deploy", which I do.

After running the deploy command, I try running "npm run dev" again, but when I do, it tells me the callback urls need to be changed again, and the loop keeps going.

Is there something I am doing wrong? Why does the application url change every time I run "npm run dev"?

I've also tried running dev, then in a separate cli tab, change the callback urls and run the deploy command. I have also changed the urls in the partners page while dev was still running, but none of that works. Every time I run dev and click on the 'Preview Url", the app page errors out saying it can't find the page.

Replies 3 (3)

Codesto1
Shopify Partner
41 3 5

[build]
automatically_update_urls_on_dev = false

MEHTEC
Shopify Partner
5 1 1

Doesn't help. URLs keep changing on shopify app dev

MEHTEC
Shopify Partner
5 1 1

I found a solution that works for me
Same problem, after app dev the URLs change and accordingly webhooks are sent to the wrong addresses
To fix this you will need 2 opened terminals
1. configure in the toml file
[build]
automatically_update_urls_on_dev = true
2. in the first terminal execute shopify app dev
3. make sure that the urls in the toml file have automatically changed
4. in the second terminal execute the shopify app deploy
5. make sure that on the partner page has a new app version with correct urls
You need to do this every time