Issue with: jQuery = require('jquery')

Hi all,

I use highcharts in some of my apps and with Enyo 2.7 have come across the following issue. I define

var jQuery = require('jquery'), highcharts = require('highcharts');

in my MainView.js. When using it like this, jQuery(chart).highcharts({...}) I get the error "jQuery(...).highcharts is not a function". When I remove jQuery = require('jquery') and add

"headScripts": [ "lib/jquery/dist/jquery.js" ],

to .enyoconfig it works. It would appear as if require with jQuery does not work, or I'm doing something wrong. :)

Regards,

Henning

Comments

  • From looking at highchart's source, it will only install as a plugin when jQuery is installed globally and I'm guessing when you require('jquery') that doesn't add jQuery to the global scope so the plugin never attaches.
Sign In or Register to comment.