module not working in Nextjs 14
hrit2773 opened this issue · 7 comments
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.
@hrit2773 would you mind to create a repo to reproduce the issue?
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?
Highlighter Module not found: Can't resolve 'react-highlight-words'
import Highlighter from 'react-highlight-words';
type InputRef = GetRef<typeof Input>;
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",
@yogithesymbian you import 'react-highlight-words 'while installing the package with types:
npm i @types/react-highlight-words
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 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 .