c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.33k stars 1.39k forks source link

c3.min.js:2 Uncaught TypeError: Cannot read property 'orgDomain' of undefined #2801

Open bhaskardabhi opened 3 years ago

bhaskardabhi commented 3 years ago

I am getting following error when trying to render the graph:

c3.min.js:2 Uncaught TypeError: Cannot read property 'orgDomain' of undefined
    at isCategorized.a.domain (c3.min.js:2)
    at l.initWithData (c3.min.js:2)
    at l.init (c3.min.js:2)
    at new n (c3.min.js:2)
    at Object.generate (c3.min.js:2)
    at Object.success (chartDashboard.php:1237)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at z (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)

This is only happening in case of proxy in between. Also this is something getting triggered by C3 not my application. Because of this issue, Graphs are not rendering.

I am using Chrome browser Version 83.0.4103.106 (Official Build) (64-bit).

Following server response:

Access-Control-Allow-Headers: origin, x-requested-with, content-type
Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS
Cache-Control: no-store, no-cache, must-revalidate
Connection: Keep-Alive
Content-Length: 291
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json
Date: Tue, 14 Jul 2020 10:09:35 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=10, max=94
Pragma: no-cache
Server: xxxxxxxx-xxxxx
Set-Cookie: PHPSESSID={SSIOD};       ; path={path}
Set-Cookie: PHPSESSID={SSIOD};       ; path={path}
Strict-Transport-Security: max-age=31536000
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Powered-By: PHP/7.2.29
X-XSS-Protection: 1; mode=block

I am not sure how to why its happening from C3 and how to handle this. Couldn't find solution anywhere.

After switching to c3.js it changed to following:

c3.js:1351 Uncaught TypeError: fgt_sslvpn.domain_restore(...) is not a function
    at ChartInternal.initWithData (c3.js:1351)
    at ChartInternal.init (c3.js:1192)
    at new Chart (c3.js:63)
    at Object.generate (c3.js:1170)
    at Object.success (chartDashboard.php:1523)
    at i (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at z (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)
kt3k commented 3 years ago

This is only happening in case of proxy in between.

Does your proxy do any modification to the script? fgt_sslvpn.domain_restore(...) this looks something c3.js doesn't have originally.