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 18? #54

Open
isaacdarcilla opened this issue Aug 9, 2023 · 8 comments
Open

React 18? #54

isaacdarcilla opened this issue Aug 9, 2023 · 8 comments

Comments

@isaacdarcilla
Copy link

Add support for React 18

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @mono/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.2.0" from @mono/[email protected]
npm ERR!   packages/frontend
npm ERR!     @mono/[email protected]
npm ERR!     node_modules/@mono/frontend
npm ERR!       workspace packages\frontend from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.13.1" from @ideasio/[email protected]
npm ERR! node_modules/@ideasio/add-to-homescreen-react
npm ERR!   @ideasio/add-to-homescreen-react@"*" from @mono/[email protected]
npm ERR!   packages/frontend
npm ERR!     @mono/[email protected]
npm ERR!     node_modules/@mono/frontend
npm ERR!       workspace packages\frontend 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.
@Sahil-K123
Copy link

Hii , could u tell me what is the cmd u used then u get this issue ?

@isaacdarcilla
Copy link
Author

npm i @ideasio/add-to-homescreen-react

https://www.npmjs.com/package/@ideasio/add-to-homescreen-react

@Sahil-K123
Copy link

In node modules is this dependency present already or not ?

@isaacdarcilla
Copy link
Author

No, it's not.

@Sahil-K123
Copy link

See in this case u can do one thing delete the node_modules folder and package.lock.json file from your folder. And again do:
npm install
and after that do:
npm i @ideasio/add-to-homescreen-react

@HimanshuGupta-p1
Copy link

Until this is fixed for now you can delete the node_modules folder and package-lock.json. Next, open package.json and change
"react": "^18.0.0" & "react-dom": "^18.0.0" to an earlier version example:
"react": "^16.13.1" & "react-dom": "^16.13.1".
Finally, you can run npm install.

Alternative Solution (Try this first!):
solution suggested by joooni1998):

delete both node_modules and package-lock.json
run npm i web-vitals --save-dev
run npm install
and then you can use npm run build and npm start again

@likelightning
Copy link

Hey guys, would be great if you can update this to support React V18 :)

@karaxuna
Copy link

Adding overrides in package.json works as a workaround:

"overrides": {
    "@ideasio/add-to-homescreen-react": {
        "react": "$react",
        "react-dom": "$react-dom"
    }
}

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

5 participants