slider icon indicating copy to clipboard operation
slider copied to clipboard

Error importing RCTooltip

Open cadavre opened this issue 4 years ago • 3 comments

I cannot build project because of import error in missing exported member of rc-tooltip.

Error as below:

ERROR in [at-loader] ./node_modules/@types/rc-slider/index.d.ts:16:10 
    TS2614: Module '"../../rc-tooltip/lib"' has no exported member 'RCTooltip'. Did you mean to use 'import RCTooltip from "../../rc-tooltip/lib"' instead?

For dependencies:

=> Found "[email protected]"
=> Found "[email protected]"

cadavre avatar May 19 '20 11:05 cadavre

I have the same error.

As i see, in @types/rc-slider/index.d.ts you have line:

import { RCTooltip } from "rc-tooltip";

This looks like reason of this error. When I installed rc-tooltip and @types/rc-tooltip as dependency of my project this error disappeared. But this shouldn't work like that.

luq10 avatar May 20 '20 08:05 luq10

Having the same issue :(

Found a workaround.

Uninstall the @types/rc-tooltip package, then add ts-ignore before the import of the Slider component:

//@ts-ignore
import Slider from 'rc-slider';

Not ideal, but at least the error go away.

dsternlicht avatar May 27 '20 10:05 dsternlicht

This is caused by the fact that the types value is missing in the package.json so typescript can't find the type definitions. I've opened a PR #670 that fixes this.

R4VANG3R avatar Jul 15 '20 09:07 R4VANG3R