Problem
When you try to enable Borlabs Cookie, the following message appears
Uncaught TypeError: Borlabs\Cookie\System\Script\BorlabsCookieGlobalsService::addProperty(): Argument #2 ($data) must be of type array, null given, called
Cause
Borlabs Cookie attempts to load the default CodeMirror editor from WordPress. This is done using the WordPress function wp_enqueue_code_editor()
. This function should return an array
, but in this case it returns null
. This results in a TypeError.
Solution
CodeMirror is a standard part of WordPress since version 4.9.0. If the function wp_enqueue_code_editor()
still does not return an expected array
, this indicates a problem. In most cases, this problem is caused by another plugin or theme.
To determine the cause, it is advisable to disable all other plugins and switch to a default WordPress theme.
If the problem no longer occurs after this change, you should reactivate each plugin in turn and check whether the error occurs again. In this way, the cause can be systematically narrowed down.