ant-design: Typescript error

  • I have searched the issues of this repository and believe that this is not a duplicate.

Steps to reproduce

Just install and run typescript.

What is expected?

No error.

What is actually happening?

node_modules/antd/lib/mentions/index.d.ts:25:51 - error TS2307: Cannot find module '_rc-mentions@0.3.1@rc-mentions/lib/Option'.

25     static Option: React.FunctionComponent<import("_rc-mentions@0.3.1@rc-mentions/lib/Option").OptionProps>;
                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/antd/lib/mentions/index.d.ts:34:50 - error TS2307: Cannot find module '_rc-mentions@0.3.1@rc-mentions/lib/util'.

34     getFilterOption: () => false | typeof import("_rc-mentions@0.3.1@rc-mentions/lib/util").filterOption | undefined;
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/antd/lib/slider/index.d.ts:2:22 - error TS7016: Could not find a declaration file for module 'rc-slider/lib/Slider'. '/Users/hsuting/Desktop/work/meep-lerna/node_modules/rc-slider/lib/Slider.js' implicitly has an 'any' type.
  Try `npm install @types/rc-slider` if it exists or add a new declaration (.d.ts) file containing `declare module 'rc-slider/lib/Slider';`

2 import RcSlider from 'rc-slider/lib/Slider';
Environment Info
antd 3.19.0
React 16.8.6
System Mac os 10.14.4
Browser Chrome 74.0.3729.157

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 18 (6 by maintainers)

Most upvoted comments

Will patch to fix this.

Updating Typescript fixed the issue for me

I also have the same problem