frappe-gantt-react icon indicating copy to clipboard operation
frappe-gantt-react copied to clipboard

Module not found: Error: Can't resolve 'frappe-gantt-react' after of use declare-module

Open rabindranathfv opened this issue 2 years ago • 0 comments

IMPORTANT I TRY TO INSTALL BUT DIDN'T WORK, I USE --FORCE FLAG

install and try to use Frappe gantt in react v18.2.0 with typescript 4.7.4

import ReactGantt from 'gantt-for-react';

Cannot find module 'gantt-for-react' or its corresponding type declarations

i try the to create @types folder and create a filename .d.ts and add declare module from 'frappe-gantt-react' and it didn't work

when i have all config ready for check the component react show this error message.

this is the component (just for more info)

import { FrappeGantt } from 'frappe-gantt-react';

export const ReactGantt = () => {
	const d1 = new Date();
  const d2 = new Date();
  d2.setDate(d2.getDate() + 5);
  const d3 = new Date();
  d3.setDate(d3.getDate() + 8);
  const d4 = new Date();
  d4.setDate(d4.getDate() + 20);
	const tasks: any = [
    {
      id: "Task 1",
      name: "Task 1",
      start: d1,
      end: d2,
      progress: 10,
      dependencies: ""
    },
    {
      id: "Task 2",
      name: "Task 2",
      start: d3,
      end: d4,
      progress: null
      // dependencies: "Task 1"
    },
    {
      id: "Task 3",
      name: "Redesign website",
      start: new Date(),
      end: d4,
      progress: 0
      // dependencies: "Task 2, Task 1"
    }]
	return (
		<FrappeGantt
		tasks={tasks}
		viewMode={'Day'}
		/>
	)
}

Module not found: Error: Can't resolve 'frappe-gantt-react'

rabindranathfv avatar Sep 05 '22 16:09 rabindranathfv