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

Strange Error when using Sanity Auto Setup #41

Closed
Balance8 opened this issue Sep 12, 2021 · 3 comments
Closed

Strange Error when using Sanity Auto Setup #41

Balance8 opened this issue Sep 12, 2021 · 3 comments

Comments

@Balance8
Copy link

Balance8 commented Sep 12, 2021

image
I get this error after spinning up a new demo project. I kept going and set up all the variables/webhooks. After lots of debugging, I cannot find a solution to Shopify not syncing with my Sanity. I double-checked all envs on local and vercel, I updated products, deployed multiple times, and tried to check out only to receive a constant 401 from /api/Shopify/product-inventory?id=6584939413682

{
  "error": "Product not found"
}

I am uncertain where to go from here.

I will note that my sanity says it has synced from Shopify
image

But my local version was pointing to the original sanity URL hull.dev which seemed strange. My deployed sanity is pointing to the correct URL. My Shopify remains empty and devoid of any products regardless of what tactics I try.

Edit: tried three times, same result each time. Also important to note I am using hobby version for vercel

@Balance8
Copy link
Author

Balance8 commented Sep 13, 2021

I have been following the step-by-step guide to the T; however, there is one discrepancy between the guide and the onboarding flow.

During Sanity's initialization, it will warn you, type Y and hit enter:
? The current folder contains a configured Sanity studio. Would you like to reconfigure it? (Y/n)
When it asks you what dataset configuration to use, go with the default.

This is where I believe there may be a configuration error with the template.

When you run sanity init, I get these results
image

There is no default option other than create a new database or production

I selected production as setting up a new database leads to having no products in sanity.

This then leads to another strange occurrence:
image

It seems the sanity is trying to deploy to the production branch on the repo instead of my own repo.

I suggest that there may be some error occurring during the sanity auto-setup, which is why I am getting the conflict - duplicate origin already exists for this project

@Balance8
Copy link
Author

I improperly assumed the demo data would sync to Shopify, whereas the opposite occurs, I need to create products in shopify which then sync to sanity

@ndimatteo
Copy link
Owner

Hey there @Balance8 I know we resolved this in the Sanity Slack, but just to recap for anyone else perusing:

  1. The deployment error you're seeing is due to a duplicate CORS entry on Sanity. It does not mean the process failed (despite how it looks). This should be fixed now for the automatic setup route regardless.
  2. Products are synced from Shopify -> Sanity (not the other way around, aside from some basic image syncing).
  3. The 401 error is because it's trying to do an inventory check for one of the demo products with your connected Shopify store. As the error indicates, your Shopify store does not have that demo product (the ID), which is expected. I highly suggest deleting all demo products and associated variants from Sanity once connecting your own Shopify account.

Feel free to reach back out if you run into any other issues or questions! 🤘

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