• Resolved ruhelamin

    (@ruhelamin)


    Hello,

    Firstly, thanks for the plugin, very useful.

    We have discovered an issue however. After installing the plugin on a local instance of WP, everything worked fine. Then after deploying it to a cloud server environment and going to the Tools > Find My Blocks page, it no longer loads, we just see a blank page.

    In console, we see two errors:

    1. 401 Unauthorized in trying to GET the blocks endpoint, example: https://subdomain.domain.com/wp-json/find-my-blocks/blocks
    2. Uncaught TypeError: can't access property "length", blocks is undefined.

    After looking into the plugin code, we noticed this request is being made in find-my-block.js on line 34540: fetch("/wp-json/find-my-blocks/blocks"). Then we realised this is happening because of a mismatch in the request url.

    Our domain is https://subdomain.domain.com/xx/wp-json/find-my-blocks/blocks (generalised for sake of example) where xx is a country code. Meaning our siteurl is https://subdomain.domain.com/xx and not https://subdomain.domain.com.

    So editing the plugin code directly in WP admin as a test and changing it to fetch("/uk/wp-json/find-my-blocks/blocks") works. The Tools > Find My Blocks page now loads and everything works.

    I’m not sure if there’s other scenarios to consider for this fetch url but it seems prepending it with siteurl would do the trick for our case. I will leave it with you of course to update it with the solution you think is best.

    Would you be able to provide any timelines on when you might be able to update the plugin with this fix?

    Once again, great plugin and many thanks.

    Regards,
    Ruhel

    • This topic was modified 3 years, 8 months ago by ruhelamin.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Find My Blocks – Does not load due to incorrect fetch url’ is closed to new replies.