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

Cart is not working; Unable to get available Countries List: Unauthorized #1038

Open
FredvanRijswijk opened this issue Jun 27, 2024 · 1 comment

Comments

@FredvanRijswijk
Copy link

This is the log on Vercel;

Error: Unable to get available Countries List: Unauthorized at (node_modules/@bigcommerce/catalyst-client/dist/index.js?67dc:204:0) at (client/management/get-countries.ts:20:19) at (app/[locale]/(default)/cart/_components/shipping-estimator/get-shipping-countries.ts:5:40) at (app/[locale]/(default)/cart/_components/checkout-summary.tsx:54:28) { digest: '3210606240' }

On localhost:3000/cart is working and sometimes gives an error on a fetch

Cause: [Error: 400779FA01000000:error:0A00041B:SSL routines:ssl3_read_bytes:tlsv1 alert decrypt error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1590:SSL alert number 51 ] { library: 'SSL routines', reason: 'tlsv1 alert decrypt error', code: 'ERR_SSL_TLSV1_ALERT_DECRYPT_ERROR' }

This is with the latest version of npm create @latest

@bookernath
Copy link
Contributor

@FredvanRijswijk the one remaining thing that depends on a non-GraphQL Admin API in Catalyst is the list of shipping countries on the Cart Estimator widget. We're very close to swapping this out with a GraphQL API, which will completely eliminate the need for an Admin API token.

What you're running into here is you probably have an Admin API token in your .env.local (BIGCOMMERCE_ACCESS_TOKEN) which does not have the correct scope to fetch shipping countries.

Your token needs the "store information & settings" scope in order for that endpoint to work. You can create a new API token in your BigCommerce control panel that has that scope if you want to fix this, or you can delete your .env.local file and re-run the CLI create command which should request the correct scope for you when you're asked to log in in the browser.

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