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

Errors in order summary without log in #212

Open
diegomassaroo opened this issue Aug 2, 2024 · 35 comments
Open

Errors in order summary without log in #212

diegomassaroo opened this issue Aug 2, 2024 · 35 comments

Comments

@diegomassaroo
Copy link

When I complete an order it logs me this error:
TypeError: Cannot read properties of undefined (reading 'replace')
If I check the props.status in orderStatusLabel it shows me empty receipt:
Screenshot 2024-08-02 at 12 29 11

Then when I try to change page and navigate the website it logs me this error:
Cannot destructure property 'type' of 'vnode' as it is null.

Do you have any suggestions?

@alexookah
Copy link
Contributor

@diegomassaroo
Are you using latest version ?

There was a similar issue:
#206
Try using latest version maybe it's related/similar issue and your problem will be resolved.

@diegomassaroo
Copy link
Author

diegomassaroo commented Aug 5, 2024

I have tried but it doesn't resolve the issue

I am using:
WordPress | 6.6.1
WooCommerce | 9.1.4
WPGraphQL | 1.27.2
WooGraphQL | 0.19.0
WPGraphQL CORS | 2.1
Woonuxt | 1.0.56

This is the error screenshot:
Screenshot 2024-08-05 at 16 32 54

@alexookah
Copy link
Contributor

@diegomassaroo
it seems that the order.status is missing. Please try the latest WooGraphQL | 0.20.0

@alexookah
Copy link
Contributor

Let us know if this resolved your problem and if resolved close this issue :)

@diegomassaroo
Copy link
Author

diegomassaroo commented Aug 5, 2024

I update WooGraphQL but it doesn't resolve the problem.
If I try incognito window or on safari it works but appear this error:
Screenshot 2024-08-05 at 19 39 41

@alexookah
Copy link
Contributor

What payment do you use to checkout? If you go to the order list does it show?

@diegomassaroo
Copy link
Author

diegomassaroo commented Aug 5, 2024

I use stripe card and yes they appear to the order list

@alexookah
Copy link
Contributor

alexookah commented Aug 5, 2024

What status do they have?

@alexookah
Copy link
Contributor

There is a pending PR which Improves checkout with stripe. And this might happen in orders when the payment has failed or some error. so the status is not defined.
But this requires a bit of testing.

@scottyzen
Will you check the PR and maybe create a new version for these issues to get fixed?

@diegomassaroo
Copy link
Author

diegomassaroo commented Aug 5, 2024

What status do they have?

They have processing status, so they are correct because products aren't virtual or downloadable.

scottyzen added a commit that referenced this issue Aug 5, 2024
@alexookah
Copy link
Contributor

alexookah commented Aug 5, 2024

@diegomassaroo
A new version has been released could you try it and check if the issue got resolved?

@diegomassaroo
Copy link
Author

In chrome it works but it display an empty receipt. Instead in incognito and on safari it display: not authorized to access this order

@alexookah
Copy link
Contributor

And this is only happening on guest checkout right?

@diegomassaroo
Copy link
Author

Yes exactly

scottyzen added a commit that referenced this issue Aug 19, 2024
scottyzen added a commit that referenced this issue Aug 19, 2024
@alexookah
Copy link
Contributor

@diegomassaroo
I see @scottyzen updated some code about this issue. Could you check the latest version and see if the problem is resolved now?

@diegomassaroo
Copy link
Author

I just checked and it still remains in a 'Logging you in...' status

@alexookah
Copy link
Contributor

I just made a guest order and it worked. Are you sure you are testing towards latest code versions? (woonuxt, wp-graphQL, woocommerce) ?

@diegomassaroo
Copy link
Author

Yes, all my plugins are updated, but I still encounter this issue when completing a guest order:
Screenshot 2024-08-31 at 15 08 49

@alexookah
Copy link
Contributor

alexookah commented Aug 31, 2024

What option do you have in WP-GRAPHQL-CORS? do you have set the SameSite CookieMode to None? share a screenshot of your settings please

@alexookah
Copy link
Contributor

also how is it in safari and how is it in Chrome?

@alexookah
Copy link
Contributor

Are you using the latest main code? can you share your website ?

@diegomassaroo
Copy link
Author

Sure, here’s the screenshot from WP-GraphQL-CORS:
Screenshot 2024-09-01 at 01 13 42

Yes, I’ve tested it on both Safari and Chrome.

This is the link to my website on Vercel:
https://bikeinnovation-fe.vercel.app

As I mentioned last time, I also noticed that when I try to log in, it remains stuck on the 'Logging you in...' status.

@alexookah
Copy link
Contributor

I just checked your website and I just found out you are using outdated code from main branch.
Please try to rebase from main your website to get latest changes and try again. it should work.

@diegomassaroo
Copy link
Author

I’ve downloaded a copy of the latest code and updated it with my GraphQL endpoint, but it still doesn’t seem to be working properly.

@alexookah
Copy link
Contributor

Try to reduce the authorized domains in wp-graphql cors plugin. keep only one localhost:3000 and one the Vercel one.

@alexookah
Copy link
Contributor

alexookah commented Sep 1, 2024

Also I am not sure if that vercel domain should work. Try connecting it with another subdomain same as the Wordpress. Maybe that's the issue.

@alexookah
Copy link
Contributor

Also can you successfully login in localhost?

@diegomassaroo
Copy link
Author

Yes, I’ve tried reducing the authorized domain, but I still can’t log in, even on localhost.

@alexookah
Copy link
Contributor

alexookah commented Sep 1, 2024

I encountered the same issue on my Woonuxt website when testing in Safari from localhost:3000—getting stuck on the "Logging you in..." message. This problem occurs only in Safari; Chrome works fine from localhost:3000 when trying to login to my remote wordpress website: https://shop.comewithreverse.com/

It appears that Safari has stricter security measures, especially when connecting to an HTTPS website from localhost without SSL, which might cause cookies to be ignored or a domain mismatch to occur, even if the cookie setting is set to None.

However, Woonuxt works correctly in Safari when accessed via HTTPS and the same domain, such as https://comewithreverse.com/. My WordPress site is located at https://shop.comewithreverse.com/.

Please try setting up a subdomain at https://staging-frontend.bikeinnovation.it/ which has same domain as your wordpress connect it with Vercel, and test again in Safari. This should resolve the issue.

@diegomassaroo
Copy link
Author

diegomassaroo commented Sep 5, 2024

I tried with another site that’s already published, which shares the same domain as my WordPress site, and I’m getting the same error.

@alexookah
Copy link
Contributor

Can you share that domain you tested?

@diegomassaroo
Copy link
Author

Sure, but I’ll need to enable test mode for Stripe if you want to test it. Just let me know, and I’ll activate it.
Here’s the link: https://www.anienepublishing.it/

@alexookah
Copy link
Contributor

alexookah commented Sep 9, 2024

I tested in the website login with safari and it worked I didnt get any "Logging you in...". like from the other website (vercel with different domains)

It's because the wordpress is in url: https://staging.anienepublishing.it/graphql same domain. So it should work.

  1. Is the aniene website using the latest main repo code?
  2. Also maybe in checkout there is something else.

I remember when I worked on this PR even if there is a checkout payment error the order was created. How did you test exactly the checkout in the aniene website?

@diegomassaroo
Copy link
Author

Yes, Aniene is using the repository from August 27, 2024, but I haven’t used layers because I didn’t succeed last time. The locale translations didn’t work as expected, so next time I’ll use layers from the beginning. I select one or more products, fill in the billing details, and proceed to payment. The order completes, but I’m still seeing that error screen.

@alexookah
Copy link
Contributor

alexookah commented Sep 9, 2024

Can you Add me in Discord, maybe we can sync so that I can test it in test mode? (#alexookah)

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

No branches or pull requests

2 participants