-
Notifications
You must be signed in to change notification settings - Fork 263
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
Chart Export feature is giving CORS issue suddenly. #602
Comments
@Neha44hz thanks for reporting! Could you please share the exact error message that you're getting in your request/response? Also, are you just clicking the exporting button on your chart, via the Please share more details. |
Hello, we are having the same issue, we use highcharts in our website and the issue is reported is Download PNG is not working. exact error is: Access to fetch at 'https://export.highcharts.com/' from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. |
I am also facing the same issue. please update once resolved or if there is any workaround ? |
BackgroundEDIT: Making another reply to my comment with a solution that I discovered this morning. I am having a similar problem; or at least an extremely similar error message. I attempted to implement exporting from Highcharts at https://utilities.ericoc.com/ today. ExampleYou can see the error message that occurs when trying to export images from both of my Highcharts charts here: NOTE: The "
As @llabend stated, nothing happens other than I receive the following CORS error message in the JavaScript console when I click any of the "Download" options in the "Export" hamburger menu of a Highchart, like so: ScreenshotConsole Message
Source CodeThe source code for this
Data Source (API)Both of these (electric and water) charts depend upon data gathered via This seems to be working well to gather display the data in the chart (as well as to provide data for a DataTables JavaScript table on the same page). CDN?I imagine that if I used the Highcharts CDN (rather than hosting my own JavaScript files), this would probably not occur? |
Including this additional Highcharts JavaScript library file locally seems to have resolved my issue! https://code.highcharts.com/modules/offline-exporting.js as can be seen on any of these pages using Highcharts, where exporting images seems to work okay now: https://utilities.ericoc.com/electric/ using the following locally hosted/referenced Highcharts JavaScript per: |
Yep, this is indeed a working solution. Just tested it. Thanks! |
@Vitalii-001 awesome - thanks for confirmation! :) @llabend would you be able to confirm whether you are including the offline-exporting.js JavaScript? If not, I would totally suggest that it might be worth giving it a shot since our error messages were so similar! |
@ericoc Yes! Thank you for your detailed notes & solution, I really appreciate it. After testing locally, I deployed to my DEV environment to test out the changes there and can confirm that including the For any Vue 3 users out there, I imported the module within each of our chart components: and then included it with the other Highcharts function calls: Exporting works again. 🥳 |
Thank you everyone in this thread. Especially @ericoc Thank you so much for the inputs to add offline-exporting. I added following lines in our common component HIghChartComponent.js import OfflineExporting from 'highcharts/modules/offline-exporting'; And it worked nicely. |
"@shiddugmail Could you please confirm which version of Highcharts you are using? I am currently using Highcharts 11.4.0, but it is not working for me." |
Hi @mujtaba36 following are the versions I am using.
Hope this helps. |
Expected behaviour
Png, jpg, pdf must download from chart export button
Actual behaviour
Its is giving CORS issue
Live demo with steps to reproduce
Product version
Affected browser(s)
The text was updated successfully, but these errors were encountered: