Is there any way to debug?

I’ve build and deployed my first Shopify function: fixed amount discount, but see error 500 when try to add a product to basket, is there any way to debug to understand what is wrong?> I am advanced rust developer, but absolutely newbie for shopify functions.

Any updates? Just tried doing the same with no luck. Followed the docs and printed to STDERR as recommended but am not seeing it in the partner dashboard.

At the moment, in order to see your debug logs printed to STDERR, you need to trigger a runtime error in your code (such as with a Rust panic). Then you can take an action which triggers your function (such as adding a product to cart or changing the quantity in the cart), which will then trigger an error report as described in the docs. The error report will show your function input and any other debug output you’ve printed to STDERR.

We are actively working on improvements to this to make debugging easier.

On another note, you shouldn’t see a 500 error in the cart as a result of your function – there should be a graceful failure on the front-end. Could you file a support ticket on that one?