Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rabindranathfv opened this issue Sep 5, 2022 · 0 comments

Comments

@rabindranathfv
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant