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

Incompatible with React versions >16 #89

Open
tconroy opened this issue May 15, 2022 · 4 comments
Open

Incompatible with React versions >16 #89

tconroy opened this issue May 15, 2022 · 4 comments

Comments

@tconroy
Copy link

tconroy commented May 15, 2022

Describe the bug
This package seems to be constrained to a React peer dependency if 16.x, making it incompatible with React 17 and 18 codebases.

I could find no reason in the code for this limitation. Any chance we could loosen up the peer dependency constraint to allow newer react projects to use this hook? :)

@Naartti
Copy link

Naartti commented Jun 10, 2022

@tconroy If you need to override peer dependencies of your dependencies, npm >v8.3 supports override in package.json as:

{
"dependencies": {},
"devDependencies": {},
"overrides": {
    "@harelpls/use-pusher": {
      "react": "^17.0.2"
    }
  },
}

mayteio added a commit that referenced this issue Aug 11, 2022
Some improvements...

#89 Incompatible with React versions >16
#40 is this hooks automatically disconnect channels?
#43 Introduce to hoist channel connection
#44 useChannel(false) to prevent eager channel connection
@chrisribal
Copy link

As an alternative to @Naartti `s solution, just ignore the legacy peers using:

npm install --save @harelpls/use-pusher --legacy-peer-deps

Hope the dependencies will get updated shortly.

@fotoflo
Copy link

fotoflo commented Nov 29, 2023

npm install --save @harelpls/use-pusher --legacy-peer-deps

This worked on my local but fails when i push to vercel.

I think i can fork the package and bump the react dependency and make a PR - is anyone accepting PRs these days?

@fotoflo
Copy link

fotoflo commented Nov 29, 2023

Strange it didn't work:

yarn install v1.22.19
warning ../package.json: No license field
[1/5] 🔍 Validating package.json...
[2/5] 🔍 Resolving packages...
[3/5] 🚚 Fetching packages...
error An unexpected error occurred: "https://packages.convoy.com/artifactory/api/npm/npm/react-is/-/react-is-17.0.1.tgz: Request failed "401 Unauthorized"".
info If you think this is a bug, please open a bug report with the information provided in "/Users/fotoflo/use-pusher/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

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

4 participants