-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useDeliveryGroup returning empty result #1173
Comments
Hello @adearriba-fik do you have a link to a store where you're seeing this? |
I'm unable to reproduce this myself but I'd like to take a deeper dive. |
I'm having the same (or similar) issue. I'm literally copying and pasting from https://shopify.dev/docs/api/checkout-ui-extensions/2023-10/apis/delivery
and I'm getting this error:
package.json
Same behavior in that this doesn't happen every time, but does happen most of the time. This is live on Peepers.com if you want to look at the chrome dev tools console. You can trigger it by changing your shipping country to Canada. This seemed to become more prevalent after we switched from the 3 page to 1 page checkout. Here is my entire Checkout.jsx in it's entirety. Pretty straightforward:
Unfortunately is does not just throw the error and move on, its uncaught, so it bombs the entire app and nothing renders. To get around this for now, I stole a fake delivery group from a unit test in this package
then conditionally use it in my |
It happens for me, when I first come to a single paged checkout page, and have zero shippping address information filled. If that is the case, Shopify will hide all shipping rates, so that means no shipping rate at all => my app crashes, and won't render again. If I fill out the shipping address information field, and then reload the page, the app will work again. I think it's definitely a bug. Thank you @peepers-rick for the temporary solution, it fixes the problem. |
I'm getting this too. I'm also literally copying and pasting from https://shopify.dev/docs/api/checkout-ui-extensions/2023-10/apis/delivery. It seeeems to happen when I first preview the checkout UI extension but it's hard to find a clean repro. For sure there's a bug here. Thanks @peepers-rick for the workaround, it seems like it's unblocked me, too. I'm using TypeScript so needed to add a type and the
|
Seeing some posts regarding Functions showing empty deliveryGroups unexpectedly as well. Same root cause? |
Just getting back into this thread, I'm gonna be working on a short term fix for I'm not aware of any functions context or what the root cause would be because it seems like "empty deliveryGroups" should be a valid case, especially in one-page. |
Additionally, we've been getting more and more reports of this from larger merchants so I think it's safe to bump this to SEV-3 |
Hello
|
@kucherenko-ae , thanks for the workaround! This fix for this will be pushed to our next stable version (2024-04) since it is technically a breaking change. We'll be allowing an |
Opened #2370 with a related Shop Pay-specific issue. |
List the package(s) involved in the issue
@shopify/checkout-ui-extensions-react Version: 0.27.1"
Describe the bug
useDeliveryGroups hook returns empty array even when there are Shipping Methods. This is not something I can reproduce constantly. Normally I need to open the store in a private tab and go to the checkout. Sometimes it happens, sometimes it doesnt.
If I refresh, it works. Seems like there is a dependency missing in the hook so it's not refreshing correctly the value.
Here is a picture of the error where I'm printing the useDeliveryGroups value in a useEffect:
Steps to reproduce the behavior:
Expected behavior
useDeliveryGroups has the Shipping Methods details.
Additional context
We are using a Shipping Method selector app named: Calcurates
The text was updated successfully, but these errors were encountered: