project_e_commerce icon indicating copy to clipboard operation
project_e_commerce copied to clipboard

FIX: STATUS 422 "The given data was invalid"

Open fedelombar opened this issue 3 years ago • 15 comments

A problem in Controller fixed.

fedelombar avatar Jun 01 '21 04:06 fedelombar

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

samerlagha avatar Jul 06 '21 16:07 samerlagha

@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.

scanner77 avatar Jul 11 '21 01:07 scanner77

i didnt receive mail.how can i fix that?

Jayshree9393 avatar Jul 21 '21 14:07 Jayshree9393

anyone please

hangdai001 avatar Aug 16 '21 14:08 hangdai001

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]

samerlagha avatar Aug 17 '21 08:08 samerlagha

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.

hangdai001 avatar Aug 19 '21 05:08 hangdai001

Yes exactly

On Thu, Aug 19, 2021, 11:21 AM hangdai001 @.***> wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/project_e_commerce/pull/23#issuecomment-901629901, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQWJLTXO3EAH4GM72FFWIODT5SLVBANCNFSM4532MOJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Jayshree9393 avatar Aug 19 '21 10:08 Jayshree9393

can anybody solve my error image

ARNAV-GHATE avatar Nov 05 '21 06:11 ARNAV-GHATE

please mail me how I proceed [email protected]

ARNAV-GHATE avatar Nov 05 '21 06:11 ARNAV-GHATE

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

koushik80 avatar Dec 29 '21 23:12 koushik80

#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: https://github.com/adrianhajdin/project_e_commerce/issues/36#issuecomment-962534605

But nothing has worked so far.

Darkskittlz avatar Mar 02 '22 07:03 Darkskittlz

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

mehulpuri avatar Apr 30 '22 09:04 mehulpuri

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.

Darkskittlz avatar Apr 30 '22 15:04 Darkskittlz

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

mehulpuri avatar May 02 '22 11:05 mehulpuri

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

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

Darkskittlz avatar May 03 '22 20:05 Darkskittlz