Babylon/materials and babylon/loaders resolve babylon/core ^5.4.0 as a sub dependency

Wanting to use babylonjs 5.4.0 in a project, but I get two instances of babylonjs core: 5.4.0 and 5.7.0, which obviously is troublesome.

The Problem is that babylon/materials and babylon/loaders resolve core ^5.4.0 as a sub dependency and that makes the package manager load core 5.7.0 because of the ^.

Resolved this by introducing a resolutions block in package.json, but I don’t think this should be happening.

This is the resolution block:
“resolutions”: {
@babylonjs/core”: “5.4.0”,
@babylonjs/loaders”: “5.4.0”,
@babylonjs/materials”: “5.4.0”
}
Thanks,

I guess the solution here is to move the dependencies to be peer dependencies. Otherwise we could set a fixed version in dependencies which has other consequences.
It’s not recommended, but in our current package structure it is possible to have different leakage versions work together. But as you say, the package.json should be constructed differently.

Thanks for the post :blush:

1 Like

Just wanted to update that all babylon dependencies are now peer dependencies! starting next version (5.12.0 will be released on Thursday).