Closed Florian-crg closed 1 year ago
I am getting this error as well but using Swell provider
@Florian-crg I managed to get mine working but, you have to add the useCheckout
hook to your provider.ts
in the BC folder. Check the comment i left in the code below.
export const swellProvider: Provider & { swell: any } = {
locale: 'en-us',
cartCookie: SWELL_CHECKOUT_ID_COOKIE,
swell,
fetcher,
cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },
customer: { useCustomer },
products: { useSearch },
checkout: { // Added this object and hook. You will have to fill in the logic for your provider's useCheckout hook.
useCheckout,
},
auth: { useLogin, useLogout, useSignup },
}
@ReevMich should do the same thing in the Shopify folder ? having the same issue
If you try the fix here https://github.com/vercel/commerce/issues/533#issuecomment-981149223 you only just get other errors further down the line. E.g. if you click into Payment Method, you get:
../packages/commerce/dist/utils/use-hook.js (24:0) @ useMutationHook
22 | export function useMutationHook(hook) {
23 | const fetcher = useFetcher();
> 24 | return hook.useHook({
You also get the same error for Shipping Method.
Getting the custom checkout to actually work therefore just feels like endless whack-a-mole.
Hi @brightonmik I have same error , were you able to solve the error ?
../packages/commerce/dist/utils/use-hook.js (24:0) @ useMutationHook
22 | export function useMutationHook(hook) {
23 | const fetcher = useFetcher();
> 24 | return hook.useHook({
25 | fetch: useCallback(({ input } = {})=>{
26 | return hook.fetcher({
27 | input,
+1
@ReevMich hay did u manage to implement a custom checkout? If so, can you please put some snippets of your useCheckout hook
I wasn't able to resolve this, we abandoned Vercel Commerce and went down a different route.
up! I'm getting the same error trying to proceed checkout with shopify from the cart drawer
I think custom checkout only works with OrderCloud 😞
Having the same issues with Saleor. Did anyone fix this issue or finally implement their own custom checkout?
Same error using Shopify commerce
same issue with bigcommerce
Looks like all the hooks (useCheckout, useSubmitCheckout) for the checkout functionality are empty. Would anyone know if its something that is coming very soon, or something that we have to roll out ourselves?
i got same error and unable to solve it. If anyone has resolved so can you please tell me. And i am using Next js storefront with vendure
Why this issue has not been solved or have no idea to solve yet.
This would be amazing if this can be addressed. This is a really wonderful project and works great otherwise, its a shame this is holding it back
same issue with shopify
Same error getting with me
Hey there! Thank you for opening this issue. We have decided to take Next.js Commerce in a new direction and will be closing out current PRs and issues due to this change. Please see this PR for more details: https://github.com/vercel/commerce/pull/966
I have just cloned the project and set my .env with BC then enabled customCheckout which display an error when clicking on checkout. See the picture bellow
TypeError: Cannot read properties of undefined (reading 'fetcher')