sdk have issue with multiple composer autoload
php 7.4 "sentry/sdk": "2.0.3"
there is a problem on Sentry\init() initializing if you require multiple composer autoload with different packages. (note: sentry is present in one of them)
because of using Composer\InstalledVersions in Jean85\PrettyVersions, in some cases the other composer class will load and there is no sentry in it.
OutOfBoundsException: Package "sentry/sentry" is not installed in /var/www/html/vendor2/composer/InstalledVersions.php:201
Stack trace:
#0 /var/www/html/vendor/jean85/pretty-package-versions/src/PrettyVersions.php(25): Composer\InstalledVersions::getPrettyVersion()
#1 /var/www/html/vendor/sentry/sentry/src/ClientBuilder.php(107): Jean85\PrettyVersions::getVersion()
#2 /var/www/html/vendor/sentry/sentry/src/ClientBuilder.php(115): Sentry\ClientBuilder->__construct()
#3 /var/www/html/vendor/sentry/sentry/src/functions.php(14): Sentry\ClientBuilder::create()
#4 /var/www/html/App.php(24): Sentry\init()
#5 {main}
thanks
@Jean85 do you have any clue on how to solve this? :)
Yes. I'll take a try to solve it
IMHO it should be solved on the project side: autoloaders are nestable, so you should have a single one that's able to reach every piece of code\class.
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀