Open judovana opened 1 year ago
Added also editable reproducert: https://jsfiddle.net/yvs6u3w9/ x https://jsfiddle.net/p3fmz5ty/
If yo remove <script src="https://jvanek.fedorapeople.org/charts/impl/prototypejs/prototype.js-1.7" type="text/javascript"></script>
the chart will reappear (or opposite if you add it, then it will disapear)
Had jsust checked against self built master of chart.js. Same issue
Have tried with tip of prototype.js; no change
for record: https://issues.jenkins.io/browse/JENKINS-70906
Expected behavior
The chart.js library will render the chart even if prototype.js is loaded.
Current behavior
Reproducer page: https://jvanek.fedorapeople.org/charts/ ; namely: https://jvanek.fedorapeople.org/charts/impl/index4-umd-deprototyped.html
I maintain set of jenkins plugins, built around chartjs1. Finally (!) I kicked myself lot enough to port them to chart.js 4, thus I set this page to track the migration 1->2->3-4. At the end, I finished only 4, as it was very smooth.
Unluckily, when I finished the migration, I found the chart is not showing properly in jenkins, although identical page shows properly outside jenkins. I found, that loading of prototype.js http://prototypejs.org/ (in any version) is killing prototpye search in chart.js.
I debugged it to call of
However, it seesm it is broken elsewhere, as without prototype.js scopes is array of length 2, but with prototype.js it is empty array. To found it reach over my JS skill.
Note, if you remove prototype.js from jenkins, the charts appear.But everything else case to work :)
Additional resources:
2017 mentions conflict with wordpress, solved by removal of prototype.js from project . Useless note, it is same trace I hit on chartj2 even with prototype.js 1.7 2018 mentions it on jenkinsci-dev group This mentions, update to 1.7.3 is fixing the issue. It did not worked for me relevant to above. PR to bump jenkins protype.js from 1.7 to 1.7.3. Caused issues, was reverted, afaik jenkins is still on 1.7 2019 stackoweeflow exact issue (with possible solution) 2020, github issue for chartjs. Not 100% related, by mention security issues and is about same function One of the few CVEs related to chart.js prototyep polution
Reproducible sample
https://jvanek.fedorapeople.org/charts/impl/index4-umd-deprototyped.html
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
4.2.1
Browser name and version
latest firefox and chromium
Link to your project
https://github.com/judovana/jenkins-chartjs-plugin