A way to remove missing dependencies warning?
See original GitHub issueReproduction
- Install Preact and React like so:
package.json
"preact": "^10.5.9",
"preact-render-to-string": "^5.1.12",
"react": "npm:@preact/compat",
"react-dom": "npm:@preact/compat",
- Install other npm modules that use
react
as their dependency - Run
Expected Behavior
Doing yarn
(e.g. yarn install [package]
) should not provide us with a list of warnings about missing React dependencies.
Actual Behavior
Instead, because we have a fairly large codebase, we’re getting 91 lines of warning messages.
I tried something like this (inside package.json), but that didn’t work either.
"peerDependencies": {
"react": "^17.0.0"
},
Looked to yarn documentation, but couldn’t find a solution. Anything you might know that could be helpful?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to fix missing dependency warning when using useEffect ...
Then it cannot show you the warning React Hook useEffect has a missing dependency: 'any thing'. Either include it or remove the dependency...
Read more >How to fix - react hook useEffect has missing dependencies?
One of the least recommended solutions to fix “React Hook useEffect has a missing dependency” is to remove the dependencies and avoid the ......
Read more >Solve - React Hook useEffect has a missing dependency error.
The warning “React Hook useEffect has a missing dependency” occurs when the useEffect hook makes use of a variable or function outside its...
Read more >Stop Lying to React About Missing Dependencies
React Hook useEffect has a missing dependency: 'params'. Either include it or remove the dependency array. What does this warning mean? Well, ...
Read more >React Hook useEffect has a missing dependency error
The warning "React Hook useEffect has a missing dependency" occurs when the useEffect hook makes use of a variable or function that we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Next.JS relies on SSR which means you need the latter,
next-plugin-preact
does the webpack alias for you. The problem is that the webpack-alias will make it so that the client-side bundle uses Preact, this however sadly doesn’t make it so that the Node bundle uses Preact, for the Node bundle we use these manual pkg.json aliases.EDIT: I’m going to close this issue since it’s not really something we can do a lot about, for the future feel free to start a discussion (not an issue) since those are more appropriate for this type of discourse.
The Preact slack is another alternative if that is any easier: https://chat.preactjs.com/