bonafideduck / react-highlight-within-textarea

React component for highlighting bits of text within a textarea
93 stars 13 forks source link

Typescript errors after importing component #183

Open omargon opened 8 months ago

omargon commented 8 months ago

Hello! I used this package and its respective components for the first time in my project. I installed the package and compiled my project without any errors. Still, when I imported the component into one of my project components, I started getting the following Typescript compilation errors. I would appreciate any help you can give me.

../../node_modules/@types/node/console.d.ts(324,13): error TS2300: Duplicate identifier 'profile'.
../../node_modules/@types/node/console.d.ts(329,13): error TS2300: Duplicate identifier 'profileEnd'.
../../node_modules/react-highlight-within-textarea/lib/esm/createDecorator.d.ts(1,30): error TS2307: Cannot find module 'draft-js' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/createDecorator.d.ts(2,27): error TS2307: Cannot find module './types' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/createDecorator.d.ts(3,101): error TS2503: Cannot find namespace 'Draft'.
../../node_modules/react-highlight-within-textarea/lib/esm/DecoratorFactory.d.ts(2,64): error TS2307: Cannot find module 'draft-js' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/DecoratorFactory.d.ts(3,59): error TS2307: Cannot find module './types' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/DecoratorFactory.d.ts(6,9): error TS2300: Duplicate identifier 'profile'.
../../node_modules/react-highlight-within-textarea/lib/esm/DecoratorFactory.d.ts(7,9): error TS2300: Duplicate identifier 'profileEnd'.
../../node_modules/react-highlight-within-textarea/lib/esm/HighlightWithinTextarea.d.ts(2,53): error TS2307: Cannot find module 'draft-js' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/HighlightWithinTextarea.d.ts(4,27): error TS2307: Cannot find module './types' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/HighlightWithinTextareaCC.d.ts(3,24): error TS2307: Cannot find module 'draft-js' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/index.d.ts(7,47): error TS2307: Cannot find module './types' or its corresponding type declarations.
../../node_modules/react-highlight-within-textarea/lib/esm/Selection.d.ts(1,29): error TS2307: Cannot find module 'draft-js' or its corresponding type declarations.
bonafideduck commented 7 months ago

This has a peer dependency. Did you npm install draft-js?