react-easy-crop: Can't import Point, Area types into a TypeScript project

Describe the bug When I follow the typescript tutorial for this module and I add: import { Point, Area } from ‘react-easy-crop/types’, I get the following error:

Unable to resolve path to module 'react-easy-crop/types'

To Reproduce Steps to reproduce the behavior:

  1. Create typescript project which uses react-easy-crop
  2. Set up basic typescript react-easy-crop example
  3. Change baseUrl in tsconfig.json to “src”
  4. See error

Expected behavior Should react-easy-crop export types?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Most upvoted comments

Hi, I don’t have a Typescript error on my end, but an eslint one (which is using typescript parser):

Unable to resolve path to module ‘react-easy-crop/types’. eslint(import/no-unresolved)

I’m writing a comment in this thread because it sounds related.

edit: I’m on v4.2.0 edit 2: Forget my comment, the import should be without trailing “/types” now, e.g.: import { Area } from "react-easy-crop"