Sebastian
Sebastian2mo ago

dist folder causes issues with React version

I had an issue where this error kept cropping up.
react.development.js:496 Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
react.development.js:496 Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.
After going through each warning message I found out that the dist folder was creating issues as I had more than one copy of React in the same app. After deleting the dist folder the issue resolved. I am able to build the project a new without having it causing issues. I think there was differing versions of react installed that caused the issue. Is this intended behaviour that deno picks up on an outdated dist folder. Any way I can prevent that in the future through some config file? Mock repo: https://github.com/bastianplsfix/postera
GitHub
GitHub - bastianplsfix/postera
Contribute to bastianplsfix/postera development by creating an account on GitHub.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?