Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot setup Highcharts 5+ with a custom window #7031

AamuLumi opened this issue Aug 2, 2017 · 2 comments

Cannot setup Highcharts 5+ with a custom window #7031

AamuLumi opened this issue Aug 2, 2017 · 2 comments


Copy link

@AamuLumi AamuLumi commented Aug 2, 2017

Hi !

I'm using Highcharts to make some server generated charts. Currently, I work with the Highcharts 4.2.6, but due to #5926, I need to work with at least the 5.0.3.

In version 4, Highcharts had the possibility to setup a custom window (created for example with JSDom). In the last version, I cannot setup the custom window because it is erased by the global object window. Here are the first lines of highcharts.src.js :

'use strict';
(function(root, factory) {
    if (typeof module === 'object' && module.exports) {
        module.exports = root.document ?
            factory(root) :
    } else {
        root.Highcharts = factory(root);
}(typeof window !== 'undefined' ? window : this, function(win) {
    var Highcharts = (function() {
         * (c) 2010-2017 Torstein Honsi
         * License:
        /* global window */
        var win = window, // Custom window is erased
            doc = win.document;

I tested by removing the var win = window line, and it worked.
The problem is I need this to be in the current npm package.

I know these lines come from the Globals.js file and the problematic line is used for front-end generation.

Is there a possibility to solve this for back-end development ?

Thanks a lot for all your job. :)

Copy link

@KacperMadej KacperMadej commented Aug 2, 2017

@TorsteinHonsi It's hard to see why win is provided as an argument and immediately a new variable of the same name is created basically erasing the argument value. Is there a reason or it's a bug?

Copy link

@AamuLumi AamuLumi commented Aug 4, 2017

Thanks for the fix ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants