Frappe gantt chart not working
Closed this issue · 8 comments
I am using the frappe gantt chart library in my html file, it was all working fine till 13th sep 2024, after that it suddenly throwing me error as -
Gantt not defined, though I’ve used online cdn links of the library, those are fine, it was working fine with that same link before, can anyone guide me what to be done to fix this?
links I am using -
<script src="https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.js"></script>Your link seems to be the minified version of the code, where all variables are renamed to single letters. This might be why you can't find 'Gantt', because in your source it's been renamed to 'B' it seems like.
Before this v0.8.0 there was a frappe-gantt.js
and a frappe-gantt.min.js
, but with this release it seems like only the minified version is available/compiled.
You could try downloading the source locally and compiling it with yarn.
so you are suggesting me to use min one? can you please provide me the cdn link and asking me to use it locally?
@Paulami31 - use https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.umd.js
please.
(or https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.umd.cjs
if you're still using 0.8.0. We'll figure this out and have a minified and other versions)
hey @safwansamsudeen I have used -
https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.umd.js
but still lookwise it is not same as it was before the updates, infact the view_mode functions are also not working, can you please check on this?
That's weird - could you share your code?
Yes, the view has changed a lot, but it isn't supposed to be broken like this. Did you import the CSS - frappe-gantt.css
?
yes I am attaching the file below, width of the container is cropping automatically, I cannot share my exact organizational code, but sharing the demo code, that is working with display, but mode change options are not working, in my original code I have sent you the ss before, the chart is cropping from right
`
<title>Frappe Gantt Chart Example</title> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <style> .gantt .bar-label { fill: #0335fc; font-size: 15px; font-weight: bold; }.zoom-buttons {
position: absolute;
top: 150px;
right: 10px;
display: flex;
gap: 5px;
}
.zoom-buttons button {
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
padding: 5px 10px;
cursor: pointer;
font-size: 18px;
}
#zoom-in::before {
content: "+";
}
#zoom-out::before {
content: "-";
}
this is a html file, the view modes are not working on clicking on the + and - button, which was working before.
an error is also coming in console -
Error initializing Gantt chart: TypeError: Cannot destructure property 'x' of 'this.computeGridHighlightDimensions(...)' as it is undefined.
@safwansamsudeen hey can you please check the issue?
That's weird - could you share your code?
Yes, the view has changed a lot, but it isn't supposed to be broken like this. Did you import the CSS -
frappe-gantt.css
?
please check the code