iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
582 stars 210 forks source link

provide a better debugging experience when peer dependencies cause multiple resolution of singleton packags #6617

Open MichaelBelousov opened 2 months ago

MichaelBelousov commented 2 months ago

Is your feature request related to a problem? Please describe.

3 or 4 different projects I am aware of in the last two weeks ran into issues where dependency updates caused undesired multiple resolutions of itwinjs-core packages which is illegal and causes (occasionally nefarious) runtime errors.

Sometimes people will accidentally commit the broken resulting lockfile too.

Describe the solution you'd like

I'm open to other potential solutions and discussions. I'd be curious if anyone has researched:

Describe alternatives you've considered pnpm override everything... causes other issues.

Additional context None

grigasp commented 2 months ago

One of the reasons that can happen is that peerDependencies in itwinjs-core are specified with ^, which tells package manager that it's fine to use a higher version. The first step, IMO, should be to fix this problem and instead specify all peer deps at exact version.