Class "Composer\Semver\Semver" not found On the setting page - Updating from 3.7 to 3.8

Hey,
I’m updating a website from 3.7 to 3.8.
I’ve got this issue when trying to access the Settings page from the menu.
Class "Composer\Semver\Semver" not found
And I can’t find anything about it online.

That class should be in the kirby\vendor folder.

How did you update?
How did you originally install kirby?

I updated by replacing the kirby folder and removing the media folder
I installed by dowloading the plainkit and launching it via php -S

@lukasbestle @texnixe Could it be an opcache or similar cache issue? Because the semver repo seems to be installed.

OPcache only caches individual files, so AFAIK it cannot prevent a new file from loading.

The issue is weird however.
@paubou Does it work if you download a new Plainkit with 3.8.1?

Yeah, a full new plainkit works well, I’m trying to upload a site I made under 3.7
Actually, I could manually move the content and assets folder. But Maybe this is a more important bug?

Thanks.

I haven’t been able to reproduce it so far. Could you send me the broken site (excluding the content folder) as a ZIP file (either as a link or via email to lukas@*)?

* Kirby’s domain omitted for spam protection

Hey, I had the same error message on the panel/system view, it turned out that I created site/vendor/autoload.php with Composer which makes Kirby’s default bootstrap.php use mine instead of site/kirby/vendor/autoload.php. Not needing my own autoload, I just removed my site/vendor folder. I’m not sure what the expected behaviour should be when using a custom Composer autoloader.

Once you use your own Composer vendor directory, Kirby expects that Kirby and all of Kirby’s dependencies are installed within it.

You can find more about this here:

Ok, thanks for the clarification, that makes sense.

So I guess I’m wishing a quite complicated setup : I love to update (+modify) kirby via GIT while I’d like to introduce composer package management for some frontend/template dependencies. (maybe more like how composer-enabled-kirby-plugins load dependencies)
I guess putting my composer vendor folder somewhere else and calling that autoloader from my templates will do the job ?

I’d recommend to create a plugin in site/plugins. Then you can install your dependencies into that and load the autoloader from the plugin’s index.php.

1 Like

Hey Lukas,
Sorry I forgot about the topic. Actally, updating to 3.8.1 and migrating the website from localhost to another url solved the issue…

Even better. Thanks for your reply. :slightly_smiling_face:

1 Like