question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A way to remove missing dependencies warning?

See original GitHub issue

Reproduction

  1. 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",
  1. Install other npm modules that use react as their dependency
  2. 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. image

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JoviDeCroockcommented, Feb 4, 2021

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.

1reaction
rschristiancommented, Feb 4, 2021

The Preact slack is another alternative if that is any easier: https://chat.preactjs.com/

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found