mirador icon indicating copy to clipboard operation
mirador copied to clipboard

ERESOLVE unable to resolve dependency tree

Open JoshuaAPhillips opened this issue 1 year ago • 2 comments

Hello,

I'm trying to install Mirador into a React project (created with create-react-app) through NPM but have been running into some difficulties – running npm i mirador etc. results in a dependencies issue. There's a chance I might be missing something blindingly obvious but would appreciate your help. You'll find the log below:

'Log files:
/Users/Joshua/.npm/_logs/2023-08-30T13_52_42_330Z-debug-0.log

# npm resolution error report

While resolving: [email protected]
Found: [email protected]
node_modules/react
  react@"^18.2.0" from the root project

Could not resolve dependency:
peer react@"^16.8.3" from [email protected]
node_modules/mirador
  mirador@"3.3.0" from the root project

Fix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Thanks!

Update: I tried installing again with the --legacy-peer-deps flag which installed the package okay, but on trying to render Mirador I ran into the following error:

ERROR in ./node_modules/mirador/node_modules/normalize-url/index.js 4:47-65
Module not found: Error: Can't resolve 'url' in '/Users/Joshua/Documents/digital-anon-react-test/node_modules/mirador/node_modules/normalize-url'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
	- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "url": false }

JoshuaAPhillips avatar Aug 30 '23 13:08 JoshuaAPhillips

Hello @JoshuaAPhillips 👋 The current release of Mirador is still using older, outdated dependencies. Work is underway to update it, but the work is complex and can only progress as contributors' availability allows. The current main branch offers a modestly-tested build running with React 17, and the latest work to run Mirador with React 18 and Material UI5 can be found in the mui5 branch. The project needs help from the community to validate the work done so far to enable a timely new release of the updated version of Mirador that addresses this and many other issues.

In the meantime, if you have a pressing need to get a Mirador project up and running immediately, developers in the community have found various ways to circumvent dependency blockers they've encountered like you, and I recommend posting in the #mirador channel of IIIF Slack instance to find who can share what they've done.

enriquediaz avatar Aug 31 '23 13:08 enriquediaz

Thanks for your quick response @enriquediaz. Can I ask if you know how far off release a production version with mui5 might be? It's not pressing - atm I'm building a prototype for an edition that doesn't need to be released in the immediate future.

JoshuaAPhillips avatar Aug 31 '23 15:08 JoshuaAPhillips