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

CORS Error While Setting Up B2B Edition Locally #171

Open
jet-gunay opened this issue Nov 20, 2024 · 2 comments
Open

CORS Error While Setting Up B2B Edition Locally #171

jet-gunay opened this issue Nov 20, 2024 · 2 comments
Assignees
Labels

Comments

@jet-gunay
Copy link

I attempted to set up the B2B Edition on my local environment (http://localhost:3000/), but I encountered a CORS error

Error details:
Uncaught (in promise) Error: {'allowed_cors_origins': [ErrorDetail(string='Invalid data', code='invalid')]} at b3Fetch.ts:104:15

Please help me set up B2B Edition locally without the CORS error.

Thank you!

@bc-marco bc-marco self-assigned this Nov 20, 2024
@SunilP-WassDigital
Copy link

SunilP-WassDigital commented Nov 22, 2024

@jet-gunay I faced same issue and resolve by
Go to apps/storefront/src/utils/loginInfo.ts and edit below thing

const { origin } = window.location; change to
const origin = 'your-store-url'; // bc stront front url

@bc-marco
Copy link
Contributor

@jet-gunay You can only use registered sites in https://api.bigcommerce.com/stores/[store_hash]/v3/sites, otherwise you will get that error

Could you also provide more information? Like the payload, tools that you're using or a video when the error happen would be helpful

@bc-victor bc-victor added the bug label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants