Shopify / dawn

Shopify's first source available reference theme, with Online Store 2.0 features and performance built-in.
Other
2.52k stars 3.39k forks source link

404 on product page #725

Open justCatalyst opened 3 years ago

justCatalyst commented 3 years ago

Product page returns a 404 page when theme branch is used on another store.

Example: Store A is created and Dawn is installed by default. Store A does some changes to Dawn and pushed those to a github repository

Store B is created and because Store A Dawn features are cool, it connects to Store A branch on github Store B pulls that branch and activates the theme. Store B is returned a 404 when accessing any product pages

Store A product page works well.

As expected, store B should display the product page correctly.

Version information (Dawn, browsers and operating systems)

resistorsoftware commented 2 years ago

What happens when you export the theme from Store A, and then import it to Store B? Same problem? Or does the problem go away?

mconnellyhd commented 2 years ago

I found the same problem and tried it a couple ways. I branched the theme from Store A and added a different branch to Store B and got the same 404. I exported from Store A and imported a zip to Store B and had the same result. But when I went to look at the actual theme on Store B, there just wasn't a product.json template included at all. Which... there was in the import.

BUT! When I tried adding it in the theme editor I got errors about missing metafields. Adding the metafields on Store B made it possible to add the product.json template, and everything worked again. SO: I'm wondering if it's just failing when it hits a missing metafield without a notification.

resistorsoftware commented 2 years ago

That is an interesting point. Direct hooks inside themes to store properties like metafields would imply a complete disconnect exists between the two. You never want to hear "Ya, this theme is great, but it needs that metafield". At least, not in a sense of the merchant's control.

mconnellyhd commented 2 years ago

In my case I was just trying to move between prod and a staging site - I wonder if it's actually nothing to do with Dawn at all and would happen the same way with any OS2 theme where a metafield had been added through the customizer.

resistorsoftware commented 2 years ago

Indeed. That does pose a slight problem for the plumbing department. There are plenty of "Gotchas" like this, so it is not surprising this one exists too, with a Customizer action resulting in a very store-specific behavior.

Dex321x commented 2 years ago

I had the same problem. Needed to add the product.json manually (and before also the two customs meta field I've had created before).

resistorsoftware commented 2 years ago

There have always been serious inconsistencies in themes. And moving to 2.0 glosses over some of them. But there is hope that more eyeballs on these issues will eventually see some of them retired. I am still relying on nothing more than finding a product.json to move forward with my app extensions, knowing that if that exists, I am probably OK.

joeybab3 commented 2 years ago

Having this exact issue, product.json makes it over just fine however as I'm using github and I've copied over all metafields but still getting a 404 on just the product pages.

brandieharmon8540 commented 2 years ago

im super new to this! i added a view all products button, when clicked it goes to 404 page not found! same when i click on catalog. how do i fix?

tronics commented 2 years ago

Same issue here. product.json was missing. I put it there but it did not help. I have not seen any metafields that I would need to copy over. Tried also an app Metafields guru to make viewing easier.

resistorsoftware commented 2 years ago

@tronics, do not forget that these days, ANY app can make private Metafields, and no one can see them except that App, if that is what the App developer wants. So you may in fact not be seeing something that is there and causing this issue.

tronics commented 2 years ago

@tronics, do not forget that these days, ANY app can make private Metafields, and no one can see them except that App, if that is what the App developer wants. So you may in fact not be seeing something that is there and causing this issue.

@resistorsoftware Very good point. Is there any way to debug this issue? I did only switch from the default Dawn theme to Symmetry.

resistorsoftware commented 2 years ago

I would just start over. Why waste time debugging this. You have the theme. You have Github. Scrap the dream of integration with multiple parties and themes, and just get it working for the usual case of one theme connected to the shop via the connector. Maybe one day this will work better, but for now, save your sanity.

tronics commented 2 years ago

Yeah, thanks. 2 things.. First: I am trying to have a copy of production from another company on my development instance for further development. So that is why I did it and why zip download upload would be quite useful. Second: How to start over.. is there a way to reinitiate everything related to the theme?

tronics commented 2 years ago

This would be all that is needed to debug. Unfortunately I do not have the 'view logs' link in the theme listing: https://joeybabcock.me/blog/tutorial/shopify-theme-development-fix-404-on-product-page/

joeybab3 commented 2 years ago

This would be all that is needed to debug. Unfortunately I do not have the 'view logs' link in the theme listing: https://joeybabcock.me/blog/tutorial/shopify-theme-development-fix-404-on-product-page/

Do you sync your theme using github? If not you won't have that log, but it should print out the errors when attempting to upload a zip file

tronics commented 2 years ago

This would be all that is needed to debug. Unfortunately I do not have the 'view logs' link in the theme listing: https://joeybabcock.me/blog/tutorial/shopify-theme-development-fix-404-on-product-page/

Do you sync your theme using github? If not you won't have that log, but it should print out the errors when attempting to upload a zip file

That is really helpful. So the reason was that I uploaded the theme directly. Does shopify check for errors on runtime, or is it only one initial check on sync or upload? Seemingly I did not get an error message when I uploaded. But the product detail has this 404. So I would really like to see shopify logging an error after I opened the erroneous page.

joeybab3 commented 2 years ago

This would be all that is needed to debug. Unfortunately I do not have the 'view logs' link in the theme listing: https://joeybabcock.me/blog/tutorial/shopify-theme-development-fix-404-on-product-page/

Do you sync your theme using github? If not you won't have that log, but it should print out the errors when attempting to upload a zip file

That is really helpful. So the reason was that I uploaded the theme directly. Does shopify check for errors on runtime, or is it only one initial check on sync or upload? Seemingly I did not get an error message when I uploaded. But the product detail has this 404. So I would really like to see shopify logging an error after I opened the erroneous page.

I wish I could tell you... I know there is sometimes liquid errors printed out on the page but the 404 was all I got when I was missing metafields... Might be worth uploading your theme to github just to get those import messages.