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

React 19 peerDependency issue caused by react-inspector #597

Open
Tracked by #716
wojtekmaj opened this issue Jan 21, 2025 · 3 comments
Open
Tracked by #716

React 19 peerDependency issue caused by react-inspector #597

wojtekmaj opened this issue Jan 21, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@wojtekmaj
Copy link
Contributor

Describe the bug

  • @ladle/[email protected] marks itself as React 19 compatible
  • It uses react-inspector dependency, which is NOT React 19 compatible, and hasn't been updated for 2 years already.

Unsure if there are any alternatives, but people seem to be navigating away from react-inspector:

Image

Reproduction

Install @ladle/react with React 19, observe peerDependency warnings coming up from your package manager, for example:

➤ YN0060: │ react is listed by your project with version 19.0.0 (p1ec28), which doesn't satisfy what @ladle/react and other dependencies request (but they have non-overlapping ranges!).

Environment

  • OS: [e.g. iOS] n/a
  • Browser [e.g. chrome, safari] n/a
  • Version [e.g. 22] n/a
@wojtekmaj wojtekmaj added the needs triage needs to be reviewed label Jan 21, 2025
@tajo
Copy link
Owner

tajo commented Jan 29, 2025

Any good alternatives? We could also fork/inline it.

@tajo tajo added enhancement New feature or request and removed needs triage needs to be reviewed labels Jan 29, 2025
@andrienko
Copy link

andrienko commented Feb 14, 2025

I am using PNPM and I just suppressed the warning (the check in my .pnpmfile.cjs) until it's fixed:

module.exports = {
  hooks: {
    readPackage(pkg) {
      // Suppressing react-inspector react peerDependency check
      if (pkg.name === 'react-inspector') {
        pkg.peerDependencies['react'] = '*';
      }
      return pkg;
    },
  },
};

Not ideal, but since I use react-inspector only with ladle - and since react is backwards-compatible - it should work.

(Maybe something won't, I haven't figured what is react-inspector used for yet, and if react 19 makes any difference in this matter, but stories work well)

@robheittman
Copy link

It appears that react-inspector is only used by the action addon, which is disabled by default, and I've been unsuccessful at turning on/using, so I'm not sure if it's actually broken or how.

But I feel like there's something missing here with the addon concept, in that they're actually tightly coupled features and dependencies. If I don't need action inspection (and thus don't need react-inspector), there's no way to fully unplug and opt-out.

Was/is the plan to separate the addons into more of a plugin architecture? If so, this one feels like a good first candidate to peel off, since it's causing problems that feel unlikely to be solved upstream given the lack of recent updates to react-inspector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants