echarts: [Bug] Documentation Website Not Loading

Version

latest

Link to Minimal Reproduction

https://echarts.apache.org/en/api.html

Steps to Reproduce

Currently the website at https://echarts.apache.org/en/api.html isn’t loading and throwing errors in both Firefox and Chrome. Errors below:

Refused to load the stylesheet 'https://fastly.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
api.html:12 Refused to load the stylesheet 'https://fastly.jsdelivr.net/npm/element-ui@2.15.14/lib/theme-chalk/index.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
$ is not defined
Uncaught TypeError: Cannot read properties of undefined (reading 'directive')
echartsDoc is not defined

Current Behavior

As mentioned above

Expected Behavior

Page loads properly

Environment

- OS:MacOS
- Browser: Firefox and Chrome
- Framework: N/A

Any additional comments?

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 38
  • Comments: 27 (3 by maintainers)

Most upvoted comments

This is due to the Content Security Policy. You can view the content by using the Chrome extension “Disable Content Security Policy.” However, please use this extension with caution.

Using that kind of extension is not something we can do at work. How long do we expect the website to be down for?

On Mon, 3 Feb 2025, 07:10 Avaray, @.***> wrote:

This is due to the Content Security Policy. You can view the content by using the Chrome extension “Disable Content Security Policy.” However, please use this extension with caution.

Wow, it works.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

— Reply to this email directly, view it on GitHub https://github.com/apache/echarts/issues/20728#issuecomment-2630137881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFC5NB2GGIS5XSBMLOJFLXL2N4I4TAVCNFSM6AAAAABWJQBINGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMZQGEZTOOBYGE . You are receiving this because you commented.Message ID: @.***>

UPDATES

  1. The theme builder and online build tool can work now.
  2. The example frame in the documentation page is available now.
  3. The GL examples can work now.
  4. The examples that depend on Baidu Maps have been removed due to the CSP.
  5. The version selector for the example editor has been removed due to the CSP.
  6. The searcher for the handbook has been removed due to the CSP.
  7. The contributor avatars in the handbook page no longer show due to the CSP.

I’m going to close this issue as resolved. Please file a new issue if you encounter other unknown problems.

Thank you all for your reports.

We are extremely sorry for the unpleasant experience caused by the unavailability of the website. This was due to the update of the Content Security Policy by the Apache Software Foundation. We have adopted a temporary solution to ensure the accessibility of the website. If you still encounter any problems, please give us your feedback. We are currently communicating with ASF, hoping to further address the issue of access speed while ensuring network security.

Many official examples are still not showing, like https://echarts.apache.org/examples/en/editor.html?c=bar-race-country https://echarts.apache.org/examples/en/editor.html?c=bar-histogram https://echarts.apache.org/examples/en/editor.html?c=heatmap-bmap https://echarts.apache.org/examples/en/editor.html?c=animating-contour-on-globe&gl=1

Currently any file not coming from domain apache.org is refused.
Before, there were several other domains allowed, like baidu.com, jsdelivr.net, etc. So the security issue is not resolved quite yet.

@patcon, thank you for pointing that one out. I think the problem is due to an omission in a recent PR. I think this line 140 and the next should be updated as follows:

echartsStatJS: `${CDN_ROOT}echarts-stat/dist/ecStat.min.js`,
echartsGLJS: `${CDN_ROOT}echarts-gl/dist/echarts-gl.min.js`,

That could fix temporarily not only ecStat, but also all 3D/GL examples people are complaining about (#20801, #20786).
@plainheart ?

seems resolved now. But the examples inside still do not show, some error “echarts.apache.org refused to connect”

This is due to the Content Security Policy. You can view the content by using the Chrome extension “Disable Content Security Policy.” However, please use this extension with caution.

Wow, it works.

https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

We are sorry about this. The ECharts website has to take some time to adapt to the new Content Security Policy of Apache server before March 1st.