Carbon-fields: Uncaught TypeError: Cannot read property error with carbon fields plugins

Created on 24 Jul 2019  路  6Comments  路  Source: htmlburger/carbon-fields

Version

  • Carbon Fields: 3.1.2
  • WordPress: 5.2.2
  • PHP: 7.*

Expected Behavior

Errorless plugin

Actual Behavior

  • Uncaught TypeError: Cannot read property 'combineReducers' of undefined
  • Uncaught TypeError: Cannot read property 'withConditionalLogic' of undefined
  • Uncaught TypeError: Cannot read property 'initialize' of undefined

  • Screenshot attachment is below:
    Carbon Fields Plugin Uncaught Property Error

Container definition

..,

Steps to Reproduce the Problem

  1. I have tested by removing and configuring all code randomly. The error is throwing without any field or some simple field code too. and It is happening on Dashboard only.

Comments

I have tested it by download direct github plugin also throwing similar error.

Most helpful comment

I have the same problem. Have tried Carbon Fields 3.1.2 and 3.1.11 with Yoast SEO on WordPress 5.3.2.

While the Yoast SEO plugin is deactivated, everything is in order. But when Yoast SEO is active, the console on the dashboard page is full of errors:

image

core.min.js?ver=3.1.11:10 Uncaught TypeError: Cannot read property 'combineReducers' of undefined
    at Module.<anonymous> (core.min.js?ver=3.1.11:10)
    at n (core.min.js?ver=3.1.11:1)
    at core.min.js?ver=3.1.11:1
    at core.min.js?ver=3.1.11:1
metaboxes.min.js?ver=3.1.11:1 Uncaught TypeError: Cannot read property 'combineReducers' of undefined
    at Module.<anonymous> (metaboxes.min.js?ver=3.1.11:1)
    at n (metaboxes.min.js?ver=3.1.11:1)
    at metaboxes.min.js?ver=3.1.11:1
    at metaboxes.min.js?ver=3.1.11:1
blocks.min.js?ver=3.1.11:11 Uncaught TypeError: Cannot read property 'withConditionalLogic' of undefined
    at Module.<anonymous> (blocks.min.js?ver=3.1.11:11)
    at n (blocks.min.js?ver=3.1.11:1)
    at blocks.min.js?ver=3.1.11:1
    at blocks.min.js?ver=3.1.11:1
index.php:2223 Uncaught TypeError: Cannot read property 'initialize' of undefined
    at index.php:2223

All 6 comments

Hi.

Have you tried setting the constant Carbon_Fields\URL?

I had an issue similar to yours in which my JS files were not being loaded.

Try adding to you wp-config.php:

define( 'Carbon_Fields\URL', 'https://www.yoursite.com/wp-content/plugins/your-plugin/vendor/htmlburger/carbon-fields' );

Notice that the constant value needs to contain the exact URL for your carbon-fields path. And you might want to use something dynamic, this is just an example.

I hope at least it can give you a direction.

@yubarajrai do you have yoast installed ? i have the same problem as you on dashboard and yoast dashboard

Hi.

Have you tried setting the constant Carbon_Fields\URL?

I had an issue similar to yours in which my JS files were not being loaded.

Try adding to you wp-config.php:

define( 'Carbon_Fields\URL', 'https://www.yoursite.com/wp-content/plugins/your-plugin/vendor/htmlburger/carbon-fields' );

Notice that the constant value needs to contain the exact URL for your carbon-fields path. And you might want to use something dynamic, this is just an example.

I hope at least it can give you a direction.

Hi @filipecsweb thanks for your response
But, there is same issues still remaining after i defined the carbon-fields url.

@yubarajrai do you have yoast installed ? i have the same problem as you on dashboard and yoast dashboard

Hi @quasiperfect
Yes, Yoast is installed on my site which is having carbon fields mentioned error.

I have the same problem. Have tried Carbon Fields 3.1.2 and 3.1.11 with Yoast SEO on WordPress 5.3.2.

While the Yoast SEO plugin is deactivated, everything is in order. But when Yoast SEO is active, the console on the dashboard page is full of errors:

image

core.min.js?ver=3.1.11:10 Uncaught TypeError: Cannot read property 'combineReducers' of undefined
    at Module.<anonymous> (core.min.js?ver=3.1.11:10)
    at n (core.min.js?ver=3.1.11:1)
    at core.min.js?ver=3.1.11:1
    at core.min.js?ver=3.1.11:1
metaboxes.min.js?ver=3.1.11:1 Uncaught TypeError: Cannot read property 'combineReducers' of undefined
    at Module.<anonymous> (metaboxes.min.js?ver=3.1.11:1)
    at n (metaboxes.min.js?ver=3.1.11:1)
    at metaboxes.min.js?ver=3.1.11:1
    at metaboxes.min.js?ver=3.1.11:1
blocks.min.js?ver=3.1.11:11 Uncaught TypeError: Cannot read property 'withConditionalLogic' of undefined
    at Module.<anonymous> (blocks.min.js?ver=3.1.11:11)
    at n (blocks.min.js?ver=3.1.11:1)
    at blocks.min.js?ver=3.1.11:1
    at blocks.min.js?ver=3.1.11:1
index.php:2223 Uncaught TypeError: Cannot read property 'initialize' of undefined
    at index.php:2223

@yubarajrai - out of interest was it only happening on localhost?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Roman52 picture Roman52  路  3Comments

MDSilviu picture MDSilviu  路  3Comments

ittikorns picture ittikorns  路  3Comments

proweb picture proweb  路  3Comments

abdusfauzi picture abdusfauzi  路  3Comments