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

Loading multiple versions of highcharts #5358

Closed
deanshub opened this issue May 31, 2016 · 3 comments
Closed

Loading multiple versions of highcharts #5358

deanshub opened this issue May 31, 2016 · 3 comments

Comments

@deanshub
Copy link

Hi,

I have highcharts3 within my system and I want to start using highcharts4 also.

I shouldn't have any problem since the latest version supports webpack...
But this line throws error 16 (multiple highcharts loaded) and stops the execution.

Expected behaviour

It should let me load highcharts more then once since i'm not overriding the highcharts of the window scope...

Actual behaviour

It throws an error and does not allow me to load highcharts 4

@jon-a-nygaard
Copy link
Contributor

Hi @deanshub,

I believe you are loading Highcharts 3 first, and Highcharts 4 last. Then Highcharts 4 will still check if Highcharts already exists on window. If this is the case, try loading Highcharts 4 before Highcharts 3.

@deanshub
Copy link
Author

I understand why this would work, but Its not possible for me to load Highcharts 4 before Highcharts 3 😞
I did managed to find a workaround using webpack's string-replace-loader, I added this to my webpack.config file

{test: /highcharts.src.js$/, loader: 'string-replace', query:{
    search:'error(16, true)',
    replace:'{win:win}',
}},

This just ignores the error and does not hurt my original Highcharts file 😉

Can you think of a better way to handle this?

@jon-a-nygaard
Copy link
Contributor

Sorry, but I can not think of a better solution for your case. 😕

I will close this issue due to we are not considering this as a bug. Should you or anyone have any further questions on the subject, just reply to this thread.

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

No branches or pull requests

2 participants