• Resolved Endymion00

    (@endymion00)


    Contributes to getting the Error: only one instance of babel-polyfill is allowed. This happens on a google map page that doesn’t even have content from this plugin. Would be helpful to have a setting for only load on pages where the shortcode is used.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author dustinscarberry

    (@dman25560)

    Sorry, I’m not able to check this page every day. Do you have an example page / plugin I can test with?

    Thread Starter Endymion00

    (@endymion00)

    The Google Map it broke was delivered by a Real Estate Service so it wouldn’t really be testable for you. The fix for me was adding code in a custom Must Use plugin that remove the plugin from loading except where necessary that I found to be on the video page itselg, while in wp-admin and calls to wp-json.

    
    if(strpos($_SERVER['REQUEST_URI'], '/the-video-page/') === FALSE && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === FALSE && strpos($_SERVER['REQUEST_URI'], '/wp-json/') === FALSE) {
             $key = array_search( 'utubevideo-gallery/utubevideo.php' , $plugins );
             if ( false !== $key ) unset( $plugins[$key] );
          }
    

    A setting in your plugin that would allow it to only load on pages the shortcode is used on would be helpful.

    Otherwise I’m not sure if it’s even possible to detect if babel-polyfill is already loaded and may even be a failing of the other plugin checking but since it’s all loading by google delivered scripts there just may not be a way of dealing with it outside of restricting where the scripts load.

    Since I only use your plugin on one page, it was similar to implement my current fix than anything else at the moment.

    Plugin Author dustinscarberry

    (@dman25560)

    Thanks. I agree that react and babel do introduce new issues. I’m not sure if their is an easy way to foolproof the plugin but I will look into further options. I’ll also consider your suggestion of adding a white / blacklist of pages to load on.

    Thread Starter Endymion00

    (@endymion00)

    Seems the babel-polyfill conflict is common with other plugins as well so perhaps one of these links may help.

    https://www.google.com/search?q=wordpress+plugin+babel-polyfill+conflict&oq=wordpress+plugin+babel-polyfill+conflict

    I’d contact the real estate plugin people but that’s like talking to a wall.

    Thread Starter Endymion00

    (@endymion00)

    This sounds like it could present some solutions.

    https://github.com/babel/babel/issues/4019

    There’s simple method to check if babel-polyfill exists already before loading it, but that only really helps if you’re the 2nd plugin to load it.

    There’s also mentions of using babel-runtime and transform-runtime instead that I guess do not have this problem.

    Plugin Author dustinscarberry

    (@dman25560)

    A fix to use the WordPress Babel polyfill has if available has been patched in to version 2.0.3. However, if another plugin is not using the same method of loading the polyfill issues could still occur.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘breaks other plugin using google maps’ is closed to new replies.