A
Alokai13mo ago
Nicole

How to Debug 404 Error - Is this VSF issue or Spree Backend?

Hi, I've setup Vue Storefront 2 multiple ways now (via git repo, with cli, etc), as well as both with my own spree backend app as well as the spree demo backend. In all instances, I'm having trouble with the home page freezing up and not properly loading. The error I get in browser console through Nuxt SSR is: [VSF][error]: n [BasicSpreeError]: Spree returned a HTTP 404 error code at a.processSpreeError (/home/<more path here>/spree/node_modules/@spree/storefront-api-v2-sdk/dist/server/index.js:1:2507) Currently, the Vue StoreFront app was setup with the steps here, simply by cloning the repo: https://github.com/vuestorefront-community/spree#manually-adding-vue-storefront-to-an-existing-spree-project The backend is currently setup with the spree backend demo site, also mentioned in the documentation. I did not run into any errors during the install or build process. How would I go about debugging this problem? Is this a Vue Storefront issue? Or a Spree backend issue? Or does this point to some configuration or environment issue on my hosting. Any insight is appreciated.
2 Replies
Nicole
Nicole12mo ago
I think I have deduced that this problem only exists on the homepage, and other pages managed by the Spree content/pages/section created in the admin dashboard. The preview page also does not render within the admin dashboard, so I am thinking this is currently a spree problem. If anyone is associated with Spree and has any ideas why preview content in the admin dashboard is not working, please let me know!
mdavo6
mdavo66mo ago
@Nicole I just came across this problem today. Digging into this, my understanding is that Vue sends the following get request to Spree to show the cart: GET "/api/v2/storefront/cart?include=line_items.variant.product.images%2Cbilling_address%2Cshipping_address". Because this is a fresh install, there is unlikely to be an order created, so spree returns a 404 error. If you add an item to the cart and then refresh the homepage does the issue disappear? This is the case for me. I am running both Vue and Spree on local which allowed me to pick up on the 404 error. It would have been impossible from the browser alone. Hope this helps.