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

Support React v18 #420

Open
CWSites opened this issue Sep 4, 2022 · 10 comments
Open

Support React v18 #420

CWSites opened this issue Sep 4, 2022 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@CWSites
Copy link

CWSites commented Sep 4, 2022

When attempting to install on a project which is using react 18.2.0 I get the following errors.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ember-agency-website@0.1.0
npm ERR! Found: react@18.2.0
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@"^17.0.2" from react-hash-scroll@1.4.7
npm ERR! node_modules/react-hash-scroll
npm ERR!   react-hash-scroll@"*" 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.
@CWSites CWSites added the bug Something isn't working label Sep 4, 2022
@github-actions
Copy link

github-actions bot commented Sep 4, 2022

Thank you for contributing to React Hash Scroll!

@YashTotale
Copy link
Owner

YashTotale commented Sep 4, 2022

Thank you for opening this issue, @CWSites. I'll try to get around to adding support for React v18 in the next few days. If this issue still persists, please ping me on this thread.

@YashTotale YashTotale self-assigned this Sep 4, 2022
@CWSites
Copy link
Author

CWSites commented Sep 6, 2022

Thanks for the quick response @YashTotale, I ran the command with --legacy-peer-deps and it's working but I'm getting the following warnings in my IDE.

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/constants.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/constants.ts'

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/functions.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/functions.ts'

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/messages.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/messages.ts'

@CWSites
Copy link
Author

CWSites commented Oct 27, 2022

Checking in here @YashTotale, any luck?

@henrybabbage
Copy link

Thank you for the library. Just to note this is not currently working with React 18 in a Next JS project.

@CWSites
Copy link
Author

CWSites commented Apr 4, 2023

Hey @YashTotale, thank you so much for this, following up to see if there is something I can do to help, do you know why React 18 isn't supported? Is it just a matter of updating the dependency list or is there functionality which is impacted by the update?

@juan-velvet
Copy link

juan-velvet commented May 17, 2023

Info bird: Not working with React 18 in a Next JS project.

When installing i get

npm i react-hash-scroll
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: velvettech.io@0.1.0
npm ERR! Found: react@18.2.0
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@"^17.0.2" from react-hash-scroll@1.4.7
npm ERR! node_modules/react-hash-scroll
npm ERR!   react-hash-scroll@"*" 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.

Edit: using --force the code doesnt work neither it throw exception

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'location')

Call Stack
Module.useLocation
node_modules/react-router/esm/react-router.js (907:0)
useHashScroll
node_modules/react-hash-scroll/cjs/react-hash-scroll.js (34:0)
HashScroll
node_modules/react-hash-scroll/cjs/react-hash-scroll.js (72:0)
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js (16305:0)
mountIndeterminateComponent
node_modules/react-dom/cjs/react-dom.development.js (20074:0)
beginWork
node_modules/react-dom/cjs/react-dom.development.js (21587:0)
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (4164:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (4213:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4277:0)

@hishamank
Copy link

Thanks for the quick response @YashTotale, I ran the command with --legacy-peer-deps and it's working but I'm getting the following warnings in my IDE.

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/constants.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/constants.ts'

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/functions.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/functions.ts'

WARNING in ./node_modules/react-hash-scroll/cjs/react-hash-scroll.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/node_modules/react-hash-scroll/src/Utils/messages.ts' file: Error: ENOENT: no such file or directory, open '/node_modules/react-hash-scroll/src/Utils/messages.ts'

I'm getting the same warnings, any updates here ?

@CWSites
Copy link
Author

CWSites commented Nov 10, 2023

This is still an issue :(

@henrybabbage
Copy link

Can we assume this library is no-more?

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

5 participants