robmellett / shopify-nuxtjs-starter

56 stars 6 forks source link

Issue generating dynamic routes with ShopifyService for static site generation #10

Open tbudin opened 3 years ago

tbudin commented 3 years ago

@robmellett I wanted to thank you for this starter kit. It was a huge help!

I have been playing with for a few weeks and, while everything worked well so far, I am having some issues with generating dynamic pages in static site generation.

In my store, I only list and link all the collections. The product pages are accessible via a collection page that fetches all associated products directly from the shopify api on page load. That means I have to dynamically generate all the pages for my static site - because if I refresh a product page (products/_handle.vue) I get a 404 Page Not Found.

In your nuxt.config.js file, you have commented the build configuration to generate dynamic pages via the service ShopifyService. When uncommenting and running generate I ran in a ReferenceError: $shopify is not defined.

Have you found a solution for this? I was wondering if we could use Speeding up dynamic route generation with payload

Thanks for your work and your help. Much appreciated!