Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve dev dependency linking (Upgrade to latest NPM) #186

Closed
timolins opened this issue May 23, 2022 · 2 comments · Fixed by #203
Closed

Improve dev dependency linking (Upgrade to latest NPM) #186

timolins opened this issue May 23, 2022 · 2 comments · Fixed by #203
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@timolins
Copy link
Owner

Currently I'm using NPM v6 for react-hot-toast and it's site, because I'm running into a dependency issue otherwise.

The ./site has a local dependency on package in the parent directory. https://github.com/timolins/react-hot-toast/blob/main/site/package.json#L22

For a reason I don't fully understand yet, I get this error while loading the demo site. However, this is only the case when I use a "newer" package manger like yarn, pnpm and npm 7 & above.

NPM v6 doesn't cause this issue, which is the workaround I've been using.

Error: 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

Resources

This issue seems to be related. I haven't found a solution though. vercel/next.js#9022

Getting rid of this caveat makes sense moving forward, as it adds friction to most incoming PR. If anyone has experience with this, please let me know!

@timolins timolins added bug Something isn't working help wanted Extra attention is needed labels May 23, 2022
@eeston
Copy link
Contributor

eeston commented May 23, 2022

Until this is resolved, it may be worthwile adding npm to engines for a bit of visibility...

timolins added a commit that referenced this issue Jul 8, 2022
- Upgrade packages
- Resolves dependency linking #186
@timolins
Copy link
Owner Author

timolins commented Jul 8, 2022

Finally got this resolved 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants