frappe / gantt

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

frappe_gantt__WEBPACK_IMPORTED_MODULE_0__ is not a constructor #290

Open justwooper opened 1 year ago

justwooper commented 1 year ago

I am getting that error when I try to use this project, I dont know what I am doing wrong, here is my code:

import { Component, OnInit } from '@angular/core'; import * as Gantt from 'frappe-gantt';

@Component({ selector: 'app-gantt', templateUrl: './gantt.component.html', styleUrls: ['./gantt.component.scss'] }) export class GanttComponent implements OnInit {

ngOnInit(): void { const tasks = [ { id: 'Task 1', name: 'Google glass', start: '2021-03-01', end: '2021-06-20', progress: 0, dependencies: '', custom_class: 'bar-milestone', // optional }, { id: 'Task 2', name: 'Google glass', start: '2021-06-20', end: '2021-08-15', progress: 0, dependencies: 'Task 1', custom_class: 'bar-milestone', // optional }, { id: 'Task 2', name: 'Google glass', start: '2021-07-10', end: '2021-09-15', progress: 0, dependencies: 'Task 1', custom_class: 'bar-milestone', // optional }, ];

const gantt = new Gantt('.gantt', tasks, {
  view_modes: ['Week', 'Month'],
  view_mode: 'Week',
  column_width: 10,
  arrow_curve: 30,
});

}

}

core.js:6498 ERROR TypeError: frappe_gantt__WEBPACK_IMPORTED_MODULE_0__ is not a constructor at GanttComponent.ngOnInit (gantt.component.ts:42:19) at callHook (core.js:2538:1) at callHooks (core.js:2507:1) at executeInitAndCheckHooks (core.js:2458:1) at refreshView (core.js:9499:1) at refreshEmbeddedViews (core.js:10609:1) at refreshView (core.js:9508:1) at refreshComponent (core.js:10655:1) at refreshChildComponents (core.js:9280:1) at refreshView (core.js:9534:1)

happyastronaut commented 11 months ago

Same issue, Angular 15

mircodamiani commented 9 months ago

Any solution?

safwansamsudeen commented 5 months ago

That's weird. We'll be fixing bugs and releasing a new version with a potentially different build (#286) - so please recheck after that. Keeping this open for now.