Closed egillanton closed 2 years ago
It seems to work if I add the handlers directly in index.js file instead of exporting the functionality to a separate file (setup-orders-webhook.js)
I suspect you may have a bodyParser of some sort being used before the call to Shopify.Webhooks.Registry.process(req, req)
.
.process
will read in and parse the stream itself - if it has already been done, then it will fail.
Also note the ordering in the app template: https://github.com/Shopify/shopify-app-template-node/blob/cli_three/web/index.js#L79-L93
We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.
We appreciate your understanding as we try to manage our number of open issues.
Issue summary
My webhook handler is not called when the following code is called:
index.js
setup-order-webhooks.js
auth.js
In my console when I run the app, get the following:
In my ngrok window I see a request being made but it doesn't respond with any status code.
Expected behavior
I am expecting the webhook handler to be called:
In my ngrok window I would expect to see
Actual behavior
When I set the breakpoint on the following line in the webhook handler, the code is never reached. console.log(
Called: ${topic} for ${shop}
);The code runs to:
I am not able to properly debug the registry.js, but I never reach request.on('end' request.on('end'
Steps to reproduce the problem
Checklist