Jump to content

Cannot declare class ComposerAutoloaderInit… because the name is already in use


Recommended Posts

This relates specifically to a problem I'm having with the Template Engine Twig module by Wanze, but I feel like it's probably a more general problem that could occur with any module installed with Composer. Feel free to move it though.

The full error message I'm getting on both front and backend is


Fatal Error: Cannot declare class ComposerAutoloaderInit2b4910144e3bc0b9eb76ddcf5c6a027c, because the name is already in use (line 5 of site/assets/cache/FileCompiler/vendor/composer/autoload_real.php)

If I move the vendor folder above webroot, the composer error goes away but when I try to access a page on the front end, I (unsurprisingly) get:


Class 'Twig\Loader\FilesystemLoader' not found

I've tried adding {# FileCompiler=0 #} to the end of the only twig template I have at the moment (which just has plain text in it). But I'm getting the composer error on both front and back end so I wouldn't think that would help anyway. I've also tried composer dump-autoload.

So why is the vendor folder getting copied to the FileCompiler folder? And is there anything I can do to stop that happening? Or stop the class name clashes?

Link to comment
Share on other sites

  • 1 year later...
  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...