Skip to content
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

FIX: STATUS 422 "The given data was invalid" #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fedelombar
Copy link

A problem in Controller fixed.

A problem in Controller fixed.
@samerlagha
Copy link

Thank you, Adrian but the code working correctly and the site in Github pages working

@scanner77
Copy link

@samerlagha Hey bro, can you help me out on this? I'm still getting
❌ HTTP ERROR [422] Type: index.js:1 The given data was invalid.

@Jayshree9393
Copy link

i didnt receive mail.how can i fix that?

@hangdai001
Copy link

anyone please

@samerlagha
Copy link

Hello everyone , sorry for answering so late ,scanner77 please send me a link to your rep to email ,
Jayshree9393 also sent a letter because I did not understand your question ,
hangdai001 the same .
[email protected]

@hangdai001
Copy link

I dont want to include any payment method and shipping methods. So i excluded it from the code. But now during checkout after I submit the confirmation page It shows the error.

@Jayshree9393
Copy link

Jayshree9393 commented Aug 19, 2021 via email

@ARNAV-GHATE
Copy link

can anybody solve my error
image

@ARNAV-GHATE
Copy link

please mail me how I proceed [email protected]

@koushik80
Copy link

koushik80 commented Dec 29, 2021

Thank you, Adrian but the code working correctly and the site in Github pages working

After I click Checkout button I'm facing the errors displayed in the pic.....I would be happy if you could help me.

Screenshot 2021-12-29 at 7 44 22 PM

Screenshot 2021-12-30 at 1 24 25 AM

@Darkskittlz
Copy link

#1 Error: The given data was invalid

I believe the problem is with the line items. Perhaps I need to stringify the email, firstname, lastname, and town_city objects.

Any help would be greatly appreciated. Below is is my error and relevant files.

Chrome DevTools Error

FIX_ STATUS 422 The given data was invalid by fedelombar · Pull Request #23 · adrianhajdin_project_e_commerce - Google Chrome 3_2_2022 1_48_56 AM

src/components/CheckoutForm/Checkout

Captures 3_2_2022 2_01_40 AM
Checkout jsx - react-art-storefront - Visual Studio Code 3_2_2022 2_01_49 AM

src/components/CheckoutForm/AddressForm

Checkout jsx - react-art-storefront - Visual Studio Code 3_2_2022 1_57_28 AM

Checkout jsx - react-art-storefront - Visual Studio Code 3_2_2022 1_57_59 AM

src/components/CheckoutForm/Checkout/CustomTextField

Checkout jsx - react-art-storefront - Visual Studio Code 3_2_2022 2_03_09 AM

src/components/CheckoutForm/Checkout/PaymentForm

Captures 3_2_2022 2_04_12 AM

PaymentForm jsx - react-art-storefront - Visual Studio Code 3_2_2022 2_04_24 AM

src/components/CheckoutForm/Checkout/Review

Captures 3_2_2022 2_05_18 AM

src/App.js

App js - react-art-storefront - Visual Studio Code 3_2_2022 2_07_26 AM

App js - react-art-storefront - Visual Studio Code 3_2_2022 2_07_55 AM

I've tried multiple fixes to this problem including the sanitized line items here: #36 (comment)

But nothing has worked so far.

@mehulpuri
Copy link

@Darkskittlz did you find a fix for it? I have the exact same problem

@Darkskittlz
Copy link

Darkskittlz commented Apr 30, 2022

Hey @mehulpuri, no I haven't found a fix yet. I feel like the data isn't being properly encoded so when the payload sends over to commerceJS the API can't read the data.

@mehulpuri
Copy link

@Darkskittlz fixed every bug , check my repository for the running website

@Darkskittlz
Copy link

@Darkskittlz fixed every bug , check my repository for the running website

Very nice! I just went through the checkout, super smooth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants