Open royalsanga24 opened 1 week ago
Are you including draftjs in yourpackage.json?
Yes, "react-highlight-within-textarea": "3.2.1", "draft-js": "^0.11.7",
These are the installed dependencies. Do I need to add any other dependency as well?
@bonafideduck I found something. The above error occurs when we create a react app using vite. I tried creating a react app using create-react-app and it works.
Not sure why this is happening with vite. Any ideas?
Using "vite": "^5.4.1"
Edit: For anyone looking to solve this, https://github.com/vitejs/vite/discussions/5912#discussioncomment-2908994 this fixed it
This seems to be in draftjs which has been abandoned. I have ideas on replacing it, but no time lately.
global is a node thing (ref). Perhaps webpack would define it.
Does adding this to your App.js help?
window.global = globalThis;
Tried using this example: https://github.com/bonafideduck/react-highlight-within-textarea?tab=readme-ov-file#usage
But getting an error in console and app not loading as well. Am I doing something wrong? The error: