Title: Undefined variable JS error
Last modified: March 26, 2020

---

# Undefined variable JS error

 *  Resolved [xarris88](https://wordpress.org/support/users/xarris88/)
 * (@xarris88)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/)
 * Hello,
 * I am experiencing the following error with the plug in (version 1.7.8):
 * TypeError: window[((“m_chart_chartjs_” + m_chart_admin.post_id) + “_1”)] is undefined
   File/Line: m-chart-chartjs-admin.js:115
 * After a little debugging I found the following:
    At the line 115, the plug in
   tries to access the window[ ‘m_chart_chartjs_’ + m_chart_admin.post_id + ‘_1’]
   field
 * but inside the window variable I saw only
    window[ ‘m_chart_chartjs_285247_2′]
 * Note that this error is not showing to all users.
    I have 3 admin users. The 
   error occurs to the two of them. The third one can use the plug in without any
   issue.
 * What I’ ve tried:
    Clearing the website cache Clearing the browser cache Using
   different browsers Firefox/Chrome/Edge Using Private Session Reinstalling the
   browser (no extensions installed) Deactivating all security applications.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12587445)
 * That is an interesting one. That number at the end is to differentiate between
   different charts on the same page. Since the admin panel only ever shows one 
   chart at a time I just hard coded the number in like that. But clearly in some
   certain situation the chart is getting an iteration number of 2.
 * Is there a place I can see this happening? I can probably get it fixed pretty
   quickly if I can duplicate the issue.
 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12587872)
 * Also please feel free to email me any additional information you want to keep
   more private:
 * jamie AT methnen.com
 *  Thread Starter [xarris88](https://wordpress.org/support/users/xarris88/)
 * (@xarris88)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12590317)
 * Wow, that was a lightning-fast response! Thank you very much!
    I had left the
   office when you replied.
 * I sent you a private message.
 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12651507)
 * This was resolved over email.
 * A universal fix will be in the next update to M Chart.
 *  Thread Starter [xarris88](https://wordpress.org/support/users/xarris88/)
 * (@xarris88)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12651921)
 * Thank you for the support.
 * You deserve a 5star review for the quality of the plugin and the support.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Undefined variable JS error’ is closed to new replies.

 * ![](https://ps.w.org/m-chart/assets/icon-256x256.png?rev=3472197)
 * [M Chart](https://wordpress.org/plugins/m-chart/)
 * [Support Threads](https://wordpress.org/support/plugin/m-chart/)
 * [Active Topics](https://wordpress.org/support/plugin/m-chart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/m-chart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/m-chart/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [xarris88](https://wordpress.org/support/users/xarris88/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/undefined-variable-js-error/#post-12651921)
 * Status: resolved