• Resolved Andrew Dixon

    (@aandrewdixon)


    If you turn on the “Combine JS” option and are using some of the built in blocks, like the Navigation block, it will break the JS as these JS scripts need the type="module" on the script tag to function. It causes a JS error like the following:

    Uncaught SyntaxError: Cannot use import statement outside a module

    to be output into the console. Upon closer inspection the JS file causing this issue comes from the WP Cache folder and has something like the following as the first line:

    // source --> /wp-includes/js/dist/script-modules/block-library/navigation/view.min.js?ver=61572d447d60c0aa5240

    I guess a possible fix would be to exclude any type="module" JS includes from the combining or create a separate JS combined file for all the type="module" JS includes and then output that file into the source HTML with the type="module" in the script tag for a combined modules JS file (if that is even possible).

    For now, simply turning off the “Combine Js” option in the WP admin works around this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘BUG: Combine JS break some built in block JS’ is closed to new replies.