XF 2.3 Composer issue even though I've removed all packages from my addon

Wutime

Well-known member
TLDR; How do I make XF forget about an AddOn having composer dependencies?


I'm getting composer issues for an AddOn despite having removed every package with "composer remove <package>"
  • I removed "composer_autoload": "vendor/composer" from the addon.json
  • I've tried xf-addon:rebuild-caches
If I remove the remaining Add/On/vendor folder, my entire XF crashes with:

An exception occurred: [ErrorException] [E_WARNING] require(vendor/composer\autoload_namespaces.php): Failed to open stream: No such file or directory in src\XF\ComposerAutoload.php on line 47

I was also getting a weird issue with this same AddOn where everytime I "composer removed any <package>" my <addon>/vendor/composer/autoload_files.php would be automatically deleted and XF would crash and complain about that in a similar manner.

It's as if XF is convinced I still have composer packages installed and it's checking for things that don't exist.

I'm assuming there's something stored in the XF database that needs to be resolved.

Does anyone know where I could start looking in the database for an addon's composer related setup/schema/settings/linages or whatever?

Really appreciate the help, this is driving me bonkers.

I marked this XF2.3, but it doesn't matter if I'm on XF2.2 or XF2.3, the issue is identical.
 
Last edited:
Well, I found xf_data_registry

I cleaned out addOnsComposer data_value

I want to rebuild caches, but unfortunately, I get the error below. I suspect if I can rebuild caches this will resolve the error.

An exception occurred: [ErrorException] [E_WARNING] foreach() argument must be of type array|object, int given in src\XF\App.php on line 2460
 
Fixed. I added the following empty json set for addOnsComposer and it finally got me the past the error:

JSON:
a:0:{}

Note, I only had one addon installed on this development community, so setting to an empty array was fine. I wouldn't suggest you do that if you have multiple addons installed using composer for obvious reasons.
 
Back
Top Bottom