mohammed-io / frappe-gantt-react

A Wrapper for the awesome Frappe Gantt library
70 stars 62 forks source link

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

Open rabindranathfv opened 2 years ago

rabindranathfv commented 2 years ago

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'