• Resolved Shane

    (@shanemarsh28)


    Hello @gabyimagely,

    You asked me to create a new thread for this so I’ll do my best to explain what is happening for us in relation to the above error code we are seeing within the console log.

    The error we are seeing on SOME but not all sites is:

    “Uncaught TypeError: Object.setProtoTypeOf called on null or undefined
    at Function.setProtoTypeOf (<anonymous>)
    at common.js?ver=3.2.4:150
    at common.js?ver=3.2.4:241”

    We have managed to trace this back to an undeclared array after the Polyfill for older browsers within this file: /wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/nextgen_gallery_display/static/common.js

    Object.setPrototypeOf(
            window.galleries,

    window.galleries is undefined.

    We have not been able to find a conflict with another plugin however this is happening to some but not all sites. The only cause we can identify for this relies on the fact that your your common.js is loading last in the enqueue of javascript files and there maybe another plugin that is using the same JS variable and defining it. Where the (currently unknown), script is not present on some sites, the variable is naturally undefined – hence the error.

    Furthermore, have not noticed any issues with other Javascript breaking due to the error however, we can only say that because your common.js appears to be the last to load in the stack. NGG Galleries appears to be operating normally with and without the error.

    So to fix this, we have added the following just above the Polyfill (just above line 150) which echos similar code you already have on line 43. This has stopped the error and “resolved” the issue for us system wide.

    if (typeof(window.galleries) == 'undefined'){ window.galleries = []; }

    I can email a working example of the modified file if you wish to examine it.

    Kind regards,
    Shane

    • This topic was modified 5 years, 9 months ago by Shane.
    • This topic was modified 5 years, 9 months ago by Shane.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thank you so much @shanemarsh28!

    We have shared your forum thread with the developers, and they let us know that they already have a fix for this particular issue and it will be available in our next release.

    Again, many thanks, having users writing us back about solutions we can apply is fantastic.
    Feel free to write us back, have an amazing weekend!

    Thread Starter Shane

    (@shanemarsh28)

    Amazing thank you – I look forward to the fix being applied in your next release.

    • This reply was modified 5 years, 8 months ago by Shane.
    Plugin Support Mihai Ceban

    (@mihaiimagely)

    Hi @shanemarsh28,

    We are happy to get back to you just to let you know that our development team have resolved the JS issue that were triggered whenever the lightbox was en-queued on pages that didn’t contained galleries.

    Thanks for your patience

    • This reply was modified 5 years, 8 months ago by Mihai Ceban.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Uncaught TypeError: Object.setProtoTypeOf’ is closed to new replies.