bvaughn / react-highlight-words

React component to highlight words within a larger body of text
https://bvaughn.github.io/react-highlight-words/
MIT License
2.16k stars 170 forks source link

module not working in Nextjs 14 #116

Closed hrit2773 closed 6 months ago

hrit2773 commented 8 months ago

I am trying to import react-highlight-words in my nextjs 14 app but its unable to recognise. I have installed it using npm i command.

sergei-startsev commented 8 months ago

@hrit2773 would you mind to create a repo to reproduce the issue?

Yukigamine commented 6 months ago

It has been working fine for me on NextJS 14, but if you have @types/react newer than 18.2.67 or so, it may throw some build errors. Is that what you are seeing?

yogithesymbian commented 6 months ago

Highlighter Module not found: Can't resolve 'react-highlight-words'

import Highlighter from 'react-highlight-words';

type InputRef = GetRef<typeof Input>;
yogithesymbian commented 6 months ago

Highlighter Module not found: Can't resolve 'react-highlight-words'

import Highlighter from 'react-highlight-words';

type InputRef = GetRef<typeof Input>;
npm i @types/react-highlight-words
...
"dependencies": {
    "@types/react-highlight-words": "^0.16.7",
sergei-startsev commented 6 months ago

@yogithesymbian you import 'react-highlight-words 'while installing the package with types:

npm i @types/react-highlight-words

sergei-startsev commented 6 months ago

Closing the issue to reduce irrelevant discussion. If you still face issues with the package in Next.js, feel free to create a new issue with a link to a sandbox that will allow to reproduce them.

yogithesymbian commented 6 months ago

@yogithesymbian you import 'react-highlight-words 'while installing the package with types:

npm i @types/react-highlight-words

i have tried rm -rf node modules and npm install again and npm run dev the error still occurs module not found. laters will try on sandbox maybe the projects is broken or something dunno why .