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

Could not resolve dependency: peer react@"^16.8.0 || 17.x" from @reach/[email protected] #7737

Closed
Drew-Daniels opened this issue Jul 17, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Drew-Daniels
Copy link

Bug report

Describe the bug

I am following the Quickstart: React tutorial for Supabase and at the step where we are asked to install @reach/visually-hidden, I get the following error in my terminal console:

Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || 17.x" from @reach/[email protected]

To Reproduce

  1. Go to Quickstart: React tutorial
  2. Run the following commands:
  • npx create-react-app supabase-react
  • cd supabase-react
  • npm install @supabase/supabase-js
  • npm install @reach/visually-hidden
  1. See the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || 17.x" from @reach/[email protected]
npm ERR! node_modules/@reach/visually-hidden
npm ERR!   @reach/visually-hidden@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/<your-user>/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/<your-user>/.npm/_logs/2022-07-17T15_34_16_590Z-debug-0.log

Expected behavior

I would expect there to not be a dependency conflict error while following the tutorial.

Screenshots

image

System information

  • OS: macOS
  • Browser: NA
  • Version of supabase-js: 1.35.4
  • Version of Node.js: 16.15.1
@Drew-Daniels Drew-Daniels added the bug Something isn't working label Jul 17, 2022
@Hallidayo
Copy link
Contributor

Hi @Drew-Daniels,

This issue is caused due to react 18 being used in the example. It appears that the @reach/visually-hidden library does not support react 18 yet but the maintainers are looking into this:

Pull Request
Github Issue

As a workaround for now you can replace the <VisuallyHidden></VisuallyHidden> component with a div which does not display:

<div style={{display: "none"}}>
   <input
   type="file"
   id="single"
   accept="image/*"
   onChange={uploadAvatar}
   disabled={uploading}
   />
</div>

Just thinking it may be worth adding a note onto the docs to help others which I can do?

@Drew-Daniels
Copy link
Author

Hi @Drew-Daniels,

This issue is caused due to react 18 being used in the example. It appears that the @reach/visually-hidden library does not support react 18 yet but the maintainers are looking into this:

Pull Request Github Issue

As a workaround for now you can replace the <VisuallyHidden></VisuallyHidden> component with a div which does not display:

<div style={{display: "none"}}>
   <input
   type="file"
   id="single"
   accept="image/*"
   onChange={uploadAvatar}
   disabled={uploading}
   />
</div>

Just thinking it may be worth adding a note onto the docs to help others which I can do?

Thanks for the context @Hallidayo ! That sounds good to me. I'd be happy to make a PR for this too if you'd rather.

@bricejoosten
Copy link

Hi @Drew-Daniels,

This issue is caused due to react 18 being used in the example. It appears that the @reach/visually-hidden library does not support react 18 yet but the maintainers are looking into this:

Pull Request Github Issue

As a workaround for now you can replace the <VisuallyHidden></VisuallyHidden> component with a div which does not display:

<div style={{display: "none"}}>
   <input
   type="file"
   id="single"
   accept="image/*"
   onChange={uploadAvatar}
   disabled={uploading}
   />
</div>

Just thinking it may be worth adding a note onto the docs to help others which I can do?

I went through the exact same issue and replacing with a div worked fine, thanks a lot.

@Hallidayo
Copy link
Contributor

Hi @saltcod - I think this can be closed as its linked with #7828

@saltcod
Copy link
Contributor

saltcod commented Oct 18, 2022

Yep for sure! Thanks @Hallidayo

@saltcod saltcod closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants