score:28
I had the exact same problem and I was struggling around many hours until I saw your entry here. Then I started over from scratch and now it works for me at least.
requirejs.config({
baseUrl:'/js/',
paths:{
jquery:'vendor/jquery',
handlebars: 'vendor/handlebars',
text: 'vendor/require-text',
chaplin:'vendor/chaplin',
underscore:'vendor/underscore',
backbone:'vendor/backbone',
highcharts: 'vendor/highcharts'
},
shim: {
backbone: {
deps: ['underscore', 'jquery'],
exports: 'Backbone'
},
underscore: {
exports: '_'
},
highcharts: {
exports: 'Highcharts'
}
},
});
Since I use Chaplin on top of Backbone, I am including some more files in my paths attribute. Highcharts has a similar structure to Backbone so I thought I could load it the same way. It works for me now. As you can see, I am introducing highcharts in the paths attribute already to export it as a shim afterwords.
Maybe this helps, otherwise let's try to contribute on it even more to solve your problem.
score:2
Although jQuery can be used as an AMD module it will still export itself to the window anyway so any scripts depending on the global jQuery
or $
will still work as long as jQuery has loaded first.
Have you tried setting a path? jQuery is an interesting one because although you're encoruaged not to name your modules by the RequireJS documentation, jQuery actually does.
From the jQuery source
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
define( "jquery", [], function () { return jQuery; } );
}
What that means is you will need to tell RequireJS where to find 'jquery'. So:
require.config({
paths: {
'jquery': 'path/to/jquery'
}
});
If you're interested in why jQuery registers itself this way then there is a pretty large comment in the source which goes into more detail
Source: stackoverflow.com
Related Query
- Loading Highcharts via shim using RequireJS and maintaining jQuery dependency
- Loading 'theme' and 'exporting' module with Highcharts using Requirejs
- Loading multiple variables using Highcharts and jquery with php
- Loading Highcharts series from XML using jQuery
- Jquery Highcharts is not loading when using with common function?
- Chrome Dev Editor Using Bower and Highcharts Shim
- Having some trouble loading highcharts using backbone and rails
- Preserving jQuery dependency for highcharts with requireJS optimizer
- Django chartit loading jquery and highcharts js
- I cannot pass in a variable into the highcharts function using jquery and pug.
- How to create a column range chart in Highcharts using range and navigator functions?
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- jQuery UI Tabs and Highcharts display/rendering issue
- Highcharts / jQuery - destroy and rebuild chart with original options
- Using html2canvas to render a highcharts chart to pdf doesn't work on IE and Firefox
- Using Highcharts and displaying a message over or on the chart when there is no data
- Convert hours and minute to millisecond using javascript or jQuery
- Using HighCharts and DotNet.HighCharts to "Play" Multiple Series
- Dual axis using percentage and absolute value to same serie in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts v3.0.1 problems with rotating data labels in IE8 and jQuery v1.7.1
- Query rails database, and update highcharts using Javascript
- Highcharts - Global configuration with common code and unique data & Headings
- Simple bar chart in jQuery HighCharts and MVC 2 application?
- drilldown maps and funnell charts on the same page using highcharts
- Changing Highcharts label and sorting x-axis using Django-chartit
- display pie chart using highcharts api and mysql
- How to dynamically update highcharts using jQuery UI sliders
- JQuery mobile and highcharts integration
- How to draw a bubble map with longitude and latitude using Highcharts in react
More Query from same tag
- How to show javascript id data into piechart (Highchart.js)?
- How to update current view in Highstock / Highcharts based on new Plotlines?
- How to change color of lable (name) in a highcharts series?
- Highcharts line chart all points disappear when have more than one points with same X Axis
- Highstock marker specific option ignored
- How to call a method on a function OR how to redraw Highcharts dynamically
- HighCharts Bug with LiveChart
- Highcharts - How to get horizontal error bars?
- Highcharts update breaks previous layout
- present halo animation in Highmap
- Highchart areaspline plotband height
- Config gauge series highchart
- How to remove weekend datetime gaps from x-axis of a financial chart?
- How to include plugins when exporting my chart?
- HighCharts Organization Nodes Overlapping
- How to update the colour of minColor and maxColor when data is changed in high charts' solid gauge in ReactJS?
- How do i color the highcharts legend square symbol when my chart has multiple color entries
- Highcharts, arithmetic operation between two graph's series points
- Highchart autoscalling
- Highcharts. Make tooltip of a specific point always visible
- Highcharts charts on a page not rendering correctly when output to PDF using wkhtmltopdf
- Highcharts line chart with multi colored areas
- how to create simple schedule chart with highchart
- Some xAxis labels are not showing in Highchart : Area Chart
- How can I reveal my chart tooltip programatically when the tooltip combines data from multiple series? (sync charts)
- Error with PhantomJS when installing Highcharts export server on Azure VM (Ubuntu 20.04)
- Maximum bar width in Highcharts column charts
- Angular5: Hide/Show yAxis in Highcharts based on the data
- Generate pdf on the fly with charts
- High Charts Center Series Label