Spaces Are Now Being Removed from Template Literals in Layout JavaScript

I have some custom JavaScript that is included in the Page Layout CSS & JavaScript dialog. I’m targeting some elements dynamically, but when the page is loaded, Beaver Builder is removing spaces inside of the template literal. This was working before, I’m not sure what update broke it. I had to switch to string concatenation.

Here’s an example, it’s really simple:

const first = "First";
const second = "Second";
console.debug( `${ first } ${ second }` );
// Output: FirstSecond
// Should be: First Second

Is anyone seeing similar issues? Was there an update that addresses this or is it a mistake?

We switched to a different minify tool as the old one did not support modern PHP and was abandoned.

Looks like there is a bug open upstream for this

Good to know, I appreciate it. I’ll keep an eye out for an update and keep using concatenation for now.

Ive subscribed to the issue too, and i’ll update the class with any fixes.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.