Page is redirecting to an unsupported URL

Page is redirecting to an unsupported URL

NewDawnUK
Tourist
4 0 3

Hello All

 

I am having a problem accessing my theme editor, pretty sure its an app as I have downloaded another theme but still have the same issue

 

I get this error message:

 

This page is not compatible with the editor due to one of the following issues:

  • Page is redirecting to an unsupported URL
  • Page failed to load due to an error

I searched and found out the below part could help, but I can not find where to make the changes (in the JavaScript code of your theme).

 

To disable the redirects, make sure to replace “window.location.href =” with “window.parent.location.href =” in the JavaScript code of your theme. Or else, you can use a reference to the window.Shopify.designMode variable in JavaScript. 

 

Can anyone please point me the right direction where to change the window.location.href = and on what file please.

Reply 1 (1)

Huptech-Web
Shopify Partner
930 187 196

Hi @NewDawnUK 
window.Shopify.designMode variable is used to detect if the theme is being viewed in the Shopify editor. You can add conditional logic to avoid redirects when in the editor. For example:

if (!window.Shopify || !window.Shopify.designMode) {
    window.location.href = "your-redirect-url";
}

 

If you still can't find the issue, it's worth disabling apps one by one to identify if an app is causing the problem. Some apps inject scripts that could cause conflicts with the editor.

If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at [email protected] or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required