highcharts / highcharts-vue

Other
686 stars 150 forks source link

Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined #157

Closed chaitanyayendru closed 4 years ago

chaitanyayendru commented 4 years ago

I am facing trouble while using Venn-series from Highcharts. I have loaded the modules correctly. My main.js looks like:

import Vue from "vue"; import PlanCompareTool from "./Components/PlanCompareTool.vue"; import ViewUI from 'iview/dist/iview'; import locale from 'iview/dist/locale/en-US'; import HighchartsVue from 'highcharts-vue' import Highcharts from 'highcharts' import VennInIt from 'highcharts/modules/venn.js'

Vue.use(Highcharts, VennInIt, HighchartsVue); Vue.use(ViewUI, { locale: locale }); VennInIt(Highcharts);

new Vue({ render: h => h(PlanCompareTool) }).$mount('#app') I was getting an error mentioned in the title.

The error was picked from this part of code in Venn.js: (function(a){"object"===typeof module&&module.exports?(a["default"]=a,module.exports=a):"function"===typeof define&&define.amd?define("highcharts/modules/venn",["highcharts"],function(q){a(q);a.Highcharts=q;return a}):a("undefined"!==typeof Highcharts?Highcharts:void 0)})(function(a){👀function q(a,e,f,k){a.hasOwnProperty(e)||👀(a[e]=k.apply(null,f))}a=a?a._modules:{};q(a,"mixins/draw-point.js",[],function(){var a=function(e){var f,a=this,t=a.graphic,p=e.animatableAttribs,h=e.onComplete,z=e.css,q=e.renderer,

Requesting for a help in this issue.

Denyllon commented 4 years ago

Hi @chaitanyayendru ,

Thank you for opening the issue. I think that the problem lies on the way of how did you initialize the Venn module, because it should be done as it is described in the documentation (https://github.com/highcharts/highcharts-vue#importing-highcharts-modules). You passed it into the Vue.use though, what is not correct approach.

Here is the example which shows how the Venn module should be imported and initialized: https://codesandbox.io/s/highcharts-vue-demo-i25x7

Kind regards!