Website was just upgraded to 2.1 (using child theme) and now all frontend pages have the following error. This seems to break javascript page-wide, such as sliders.
I have the same Error, but only inside the builder.
Everything renders fine inside the builder,except for one Custom Element that is useing the bricksSwiper script, if that helps. (It used to work completly fine before).
<?php
if (!defined('ABSPATH')) exit;
class UF_Hero_Slider extends Userfreunde\Bricks\Element
{
public $category = self::DEFAULT_CATEGORY;
public $name = 'uf-hero-slider';
public $icon = 'ti-layout-slider-alt';
public $tag = 'div';
public $scripts = ['bricksSwiper'];
Also I get a lot of TypeErrors like below, all related to bricks.min.js:
Uncaught TypeError: can't access property "run", bricksFormFn is undefined
Uncaught TypeError: can't access property "run", bricksBackgroundVideoInitFn is undefined
Uncaught TypeError: can't access property "run", bricksBackgroundVideoInitFn is undefined
...
@Matej I can’t give you access to that perticular site today, since I want to launch it later and the domain will change, but I can look into it next week.
Had the same problem.
Replaced it with if(document.body && document.body.classList.contains(“block-editor-page”)) to prevent the error.
The if-clause fires too early. It is not waiting for the page to be loaded and ready, so document.body does not exist yet.