Closed muchisx closed 1 month ago
You could try restoring app configuration from the Partner Dashboard with: "npm run shopify app config link"
In addition to what @ccarlosm suggested, could you please confirm whether running shopify app dev
before deploying fixes it?
There might be an issue with the webhook declaration if you haven't assigned a "proper" URL to your app by running dev
before.
Hope this helps!
@paulomarg
I am also getting this error when using a relative URI.
I am confused with how to implement in development with an automatically updated cloudflare url. The docs specifically mention to use a relative uri:
| In this case, leverage Shopify's support of relative paths for the URI: uri = "/webhooks"
Error
| App configuration is not valid
│ Validation errors in shopify.app.toml:
│
│ • [webhooks.subscriptions.0.uri]: URI isn't correct URI format of
│ https://, pubsub://{project}:topic or Eventbridge ARN
Code
[[webhooks.subscriptions]]
uri = "/api/webhooks"
compliance_topics = [
"customers/data_request",
"customers/redact",
"shop/redact",
]
Can you provide some clarity on how to work with HTTPS webhooks in development?
I just ran an app using this config:
[webhooks]
api_version = "2024-01"
[[webhooks.subscriptions]]
topics = [ "app/uninstalled" ]
uri = "/webhooks"
compliance_topics = [ "customers/data_request", "customers/redact", "shop/redact" ]
and it works as expected. Can you please confirm whether you're using the latest version of the CLI? I was using 3.64.1
.
🙏 🙏 🙏
Updating my CLI fixed the issue. Thank you for the assistance @paulomarg.
It's appreciated!!
I had the same problem with "shopify app deploy" and it was fixed after I upgraded the CLI. However when I run "npm run dev" I get the same error message again complaining about URI on the wrong format. Any solutions for this problem?
Edit: "shopify app dev" solved it
[[webhooks.subscriptions]] topics = [ "app/uninstalled" ] uri = "/webhooks" compliance_topics = [ "customers/data_request", "customers/redact", "shop/redact" ]
This works with me. Thank you
It sounds like this was working for pretty much everyone once they updated the CLI, so I'm going to go ahead and close this issue. Please let us know if you still have problems!
I just ran an app using this config:
[webhooks] api_version = "2024-01" [[webhooks.subscriptions]] topics = [ "app/uninstalled" ] uri = "/webhooks" compliance_topics = [ "customers/data_request", "customers/redact", "shop/redact" ]
and it works as expected. Can you please confirm whether you're using the latest version of the CLI? I was using
3.64.1
.
I have tried this setup. After running npm run dev, my TOML file becomes: [[webhooks.subscriptions]] uri = "webhooks" compliance_topics = [ "customers/data_request", "customers/redact", "shop/redact" ] and I still encounter the error. My shopify cli version is 3.64.1
@DuyHiepVP2003 that's a bug in the CLI, it should be fixed here and hopefully included in the next release this week.
As a workaround, you can replace the uri
in your TOML from webhooks
to /webhooks
.
Issue summary
Before opening this issue, I have:
@shopify
packages@shopify/shopify-*
package and version:"@shopify/cli": "^3.61.2"
v20.11.1
windows 11
{ logger: { level: LogSeverity.Debug } }
in my configurationExpected behavior
The relative URL should work before being added to the remix template (This is probably an issue with the cli, or the @shopify/app package?
Actual behavior
Declaring a webhook subscript as such:
https://github.com/Shopify/shopify-app-template-remix/blob/ef188ef9616c62785168a5759b2d0b60a0da6086/shopify.app.toml#L8-L10
And then running
npm run deploy
throws an error such as:Here's my entire
shopify.app.toml
aswell:Steps to reproduce the problem