marcysutton / frontend-masters-enterprise-accessibility

A repo for the Enterprise Accessibility workshop for Frontend Masters
https://enterprise-accessibility.vercel.app/topics
34 stars 10 forks source link

react-aria/ssr dependency issue #2

Closed frankstallone closed 4 weeks ago

frankstallone commented 2 months ago

Howdy! I started this Enterprise Accessibility course today (Sep 9, 2024), and couldn't be more excited! I've been a huge fan of Marcy's work for years! I ran into an issue when running npm i on this project.

Node: v20.12.2

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: enterprise-accessibility@1.0.0
npm ERR! Found: react@18.2.0
npm ERR! node_modules/react
npm ERR!   react@"18" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.0 || ^17.0.0-rc.1" from @react-aria/ssr@3.1.2
npm ERR! node_modules/@react-aria/ssr
npm ERR!   @react-aria/ssr@"3.1.2" 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! 
npm ERR! For a full report see:
npm ERR! /.../.../.npm/_logs/2024-09-09T13_43_42_218Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/bb-8/.npm/_logs/2024-09-09T13_43_42_218Z-debug-0.log

It looks like a pretty straightforward issue. react-aria/ssr is looking for React 16 or 17 but we're using React 18. Looking at that package, it and @react-aria/live-announcer has rolled into Adobe Spectrum.

I will note that npm i --force does work for all intents and purposes but is obviously not ideal. I don't know enough about this project and where it's using these dependencies yet to create a PR but I will if I get to it before anyone else who may fix the issue before.

marcysutton commented 1 month ago

Hey @frankstallone, thanks so much for the issue. I'll take a look and see what updates I want to make!

marcysutton commented 1 month ago

@frankstallone I see that you ran npm i, and I got the same result. But then I remembered I set this project up with yarn 😅

I got it to build fine with a clean install, using rm -rf node_modules && rm package-lock.json and then running yarn to reinstall packages. Can you see if that works for you?

I'm also not seeing live-announcer released under react-spectrum. It appears to still be part of the @react-aria package on npm and GitHub:

Maybe the package will change eventually? Let me know if I missed something...the docs on these two particular packages don't really exist!

frankstallone commented 4 weeks ago

Oye @marcysutton — I apologize. You're right. I used npm and not yarn. I thought, "It's the same, right?" and I should have known better. 🙈 I have to install yarn and give that a shot but presuming that was the issue we can close this ticket.

My comment on the moves for @react-aria/ssr and @react-aria/live-announcer was from their respective npm package descriptions. 😇