• BlackStar

    (@blackstar1991)


    Hi, I found a compatibility issue between WP-Optimize Minify and a WordPress plugin that uses frontend ES module scripts.

    The plugin enqueues a JavaScript file that contains ES module imports, so it must be loaded with type=”module”. When WP-Optimize JavaScript minification/combination is enabled, the frontend animation script either does not load correctly or is processed in a way that causes the browser error:

    Uncaught SyntaxError: Cannot use import statement outside a module

    After excluding the plugin’s JS module files from WP-Optimize minification, the issue disappears and the animation works correctly.

    Could you please check how WP-Optimize handles scripts registered with type=”module” or scripts modified through the script_loader_tag filter?

    Affected files in my case:

    Affected files in Timeline Full Widget 2.2.0:

    Expected behavior:
    WP-Optimize should preserve type=”module” and avoid combining ES module scripts with regular scripts, or provide a reliable exclusion mechanism for module scripts. Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Support jbgupdraft

    (@jbgupdraft)

    Hi,

    Thanks for reporting this! I will pass this along to our Product team to investigate and see if we can add something to our roadmap so that module scripts are excluded from the Minification and Merging process.

    I’m glad to hear that manually excluding them allowed the scripts to function properly while still keeping the Minification and Merging enabled for other javascript files.

    Thank you!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.