Missing Dependencies for chartjs-adapter-moment

Describe the issue in as much detail as possible. Please remove the sections below if the issue is obvious enough and doesn’t require extra details.

Missing Dependencies :
chartjs-adapter-moment
[wp-content/plugins/hivepress/node_modules/chartjs-adapter-moment/dist/chartjs-adapter-moment.min.js]
chartjs (missing), moment

Steps to reproduce

List the steps to reproduce the issue.
-) Install Debugger plugin like query monitor for easier to debug
-) Go to homepage, click the scripts tab in query monitor

Actual result

Describe the actual result.

Expected result

Describe the expected result.

Extra details

Add a link to your site, screenshots or any other details that may help us pinpoint the issue.

Hi,

Please send a screenshot of the plugins you are using. Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

This bug still exist since last year. There’s also a screenshot in this post:

Hi,

We checked this issue from our side, and it seems okay. On our end, we couldn’t reproduce the issue, and the error doesn’t show up in the console. Also, please note that we couldn’t confirm this issue last year either, so it’s not a bug for now.

Please provide more details regarding this issue (e.g., your actions step by step with screenshots, screencast, etc.). This will help us to reproduce and resolve the issue faster.

This is obviously a bug.

Just check this file /wp-content/plugins/hivepress/includes/configs/scripts.php (line 69), you will see ‘chartjs’ and ‘chartjs-adapter-moment’ have a different scope, thus it complain chartjs missing on frontned :

	'chartjs'                => [
		'handle' => 'chartjs',
		'src'    => hivepress()->get_url() . '/node_modules/chart.js/dist/chart.min.js',
		'scope'  => [ 'backend' ],
	],

	'chartjs_adapter_moment' => [
		'handle' => 'chartjs-adapter-moment',
		'src'    => hivepress()->get_url() . '/node_modules/chartjs-adapter-moment/dist/chartjs-adapter-moment.min.js',
		'deps'   => [ 'chartjs', 'moment' ],
		'scope'  => [ 'frontend', 'backend' ],
	],

@ihor could you please sometimes do a random check on andrii’s response. I read most of his response is just ignoring user submitted problems/inputs without even doing real checking. :folded_hands:

There is no error in the console. The website still functions, however there is no need to load something when it is not used. As reported in Moments.js Javascript error on all pages except dashboard .

Please install the Query monitor plugin Query Monitor – The developer tools panel for WordPress – WordPress plugin | WordPress.org (must have, can not live without) and it will show you that it is loaded on all pages, the only page where there is no issiue (Moments loaded without CharJS) is in the vendor dashbaord where the gapsh are.

1 Like