frappe / gantt

Open Source Javascript Gantt
https://frappe.io/gantt
MIT License
4.67k stars 1.04k forks source link

Frappe gantt chart not working #432

Closed Paulami31 closed 3 weeks ago

Paulami31 commented 4 weeks ago

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 -

image

KebabRonin commented 4 weeks ago

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.

Paulami31 commented 3 weeks ago

so you are suggesting me to use min one? can you please provide me the cdn link and asking me to use it locally?

safwansamsudeen commented 3 weeks ago

@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)

Paulami31 commented 3 weeks ago

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?

image

safwansamsudeen commented 3 weeks ago

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?

Paulami31 commented 3 weeks ago

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

`<!DOCTYPE html>

Frappe Gantt Chart Example
` 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. ![Screenshot 2024-09-23 125852](https://github.com/user-attachments/assets/51ae2eb9-1bb7-4e74-b331-c2aa98f0e89d)
Paulami31 commented 2 weeks ago

@safwansamsudeen hey can you please check the issue?

Paulami31 commented 2 weeks ago

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