notrab / headless-dropshipping-starter

Create your own dropshipping store with Next.js, Snipcart & Printful 👕
https://headlessdropshipping.com
712 stars 134 forks source link

Snipcart shipping 401 Permanent Redirect #61

Closed pythlang closed 2 years ago

pythlang commented 2 years ago

I have deployed to my server successfully; however, I receive this error after configuring snipcart to work normally on my local env.

Screen Shot 2022-04-28 at 21 46 48

pythlang commented 2 years ago

Here are the snipcart responses:

Screen Shot 2022-04-28 at 21 51 15

I recently added an SSL on the server using Let'sEncrypt; I'm not sure what could be going on here?

pythlang commented 2 years ago

Is there any way we can look at what is happening here? Do you think it has to do with the printful API keys? @notrab

notrab commented 2 years ago

Hey @pythlang

Sorry for the delay, there was a similar discuss in another issue which left this go unresolved.

Let me spin up my store, and see if anything has changed in any of the APIs changed. However, I've had reports from 2 people recently deploying this that went without any issues, so it could be a configuration option your side that's causing the above.

pythlang commented 2 years ago

Well, I was able to circumvent this by adding a standard flat shipping rate which is what I wanted anyway but it is frustrating that I was getting this error.

also, I then received another error that the product-crawling-failed.

How did I fix that? I went into the Product.tsx and went thru the docs which stated that the price as a number and url as a string are the only things required; it looks like the price was a string so I casted the variable to {… as number} and rebuilt then everything worked fine.

If you want to get in a call to see what I have going on to solve the other issue that would work.

notrab commented 2 years ago

Have you tried using the snipcart tool to crawl it manually to see what’s up? Does the API return any errors to hint why this is happening?

pythlang commented 2 years ago

Nope, I didn’t use the tool. It said the id at the url, which looked valid other than the type mismatch, was not found. Well, it was there so it looks like somehow the variable was being interpolated as a string instead of a number. After I did the cast like I said, it worked after rebuilding.

pythlang commented 2 years ago

I was able to complete an order 👍🏼