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

Update @supabase/auth-ui-react to use react and react-dom as peerDependencies #195

Open
Alex-Yakubovsky opened this issue Jul 31, 2023 · 0 comments

Comments

@Alex-Yakubovsky
Copy link

Chore

Update @supabase/auth-ui-react to have react and react-dom as peer dependencies.

I'm currently using react@next as dependency for my project. Installing @supabase/auth-ui-react ends up also including [email protected]. Here's the out for pnpm why react for my project:

dependencies:
@heroicons/react 2.0.18
└── react 18.3.0-canary-493f72b0a-20230727 peer
@remix-run/react 1.19.1
├── react 18.3.0-canary-493f72b0a-20230727 peer
├─┬ react-dom 18.3.0-canary-493f72b0a-20230727 peer
│ └── react 18.3.0-canary-493f72b0a-20230727 peer
└─┬ react-router-dom 6.14.2
  ├── react 18.3.0-canary-493f72b0a-20230727 peer
  ├─┬ react-dom 18.3.0-canary-493f72b0a-20230727 peer
  │ └── react 18.3.0-canary-493f72b0a-20230727 peer
  └─┬ react-router 6.14.2
    └── react 18.3.0-canary-493f72b0a-20230727 peer
@supabase/auth-ui-react 0.4.2
├── react 18.2.0
└─┬ react-dom 18.2.0
  └── react 18.2.0 peer
react 18.3.0-canary-493f72b0a-20230727
react-dom 18.3.0-canary-493f72b0a-20230727
└── react 18.3.0-canary-493f72b0a-20230727 peer

This ends up crashing my app with an Invalid hook call error due to multiple copies of React.

Describe the chore

  • move react and react-dom from dependencies to peerDependencies and devDependencies.

Additional context

For others who need a workaround; if you're using pnpm you can use the overrides functionality by updating your root package.json with

{
  // ...
  "pnpm": {
    "@supabase/auth-ui-react>react": "next",
    "@supabase/auth-ui-react>react-dom": "next"
  }
}

I'd be happy to create a PR for this, guidelines just ask for contributors to submit an issue first.

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

No branches or pull requests

1 participant