Magento2: Fatal error: Cannot instantiate interface

Created on 24 Nov 2015  路  13Comments  路  Source: magento/magento2

My magento store is throwing this error:

Fatal error: Cannot instantiate interface Magento\Framework\View\Design\Theme\ResolverInterface in /Library/WebServer/Documents/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I don't know why it started to appear. I made no new module installation. The store was working fine.

I've check file permissions and I see no issue there. Also deleted /var/ dir and folders/files where created.

The preference is defined vendor/magento/magento2-base/app/etc/di.xml

<preference for="Magento\Framework\View\Design\Theme\ResolverInterface" type="Magento\Theme\Model\Theme\Resolver" /> 
needs update

All 13 comments

@bvboas can you please give more details about your environment, and how to reproduce this error? Navigate to front end or backend after installation?

OS: MAC OS X 10.9
PHP 5.6.11
Apache/2.2.29 (Unix)

I don't have any third-party extension enabled.

I just have to visit any page, frontend or backend, for the error to show.

@bvboas what mode are you in?

@mazhalai The .htaccess directive

SetEnv

is commented. So I assume is in 'default'

Switched to developer and production, but the error persists.

@bvboas can you check apache or php logs to see if there is any stack trace?

You might check the di.xml file to see if you added a comment and failed to close it correctly, or something silly like that to cause the

@alankent You were right.

I've just switched to phpStorm, and since there are no warnings about saving changes, for some reason

<preference for="Magento\Framework\View\Design\Theme\ResolverInterface" type="Magento\Theme\Model\Theme\Resolver" />

became

<preference for="Magento\Framework\View\Design\Theme\ResolverIdeveloperMaterializationnterface" type="Magento\Theme\Model\Theme\Resolver" />

Sorry about this.

@bvboas thank you for your update. Closing this issue. Please feel free to open a new one in case of any issues.

"You were right." SCORE!!!

Ahem. Glad to be of help.

i dont understand, how you resolve this problem, can you please explain it again, because i have the same error and search for a solution my last 5 hours

@rexha5minds it was an issue with the di.xml file. Make sure you haven't made any changes.

I have had this issue as well, having the deploy mode set to developer. Turns out I got this error because I used --no-dev when installing the application.

As @alankent says "Check your di.xml"

I didn't realise you need to add it as a preference if you instantiate it. Documentation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

punkstar picture punkstar  路  3Comments

denis-g picture denis-g  路  3Comments

kirashet666 picture kirashet666  路  3Comments

PushEngineering picture PushEngineering  路  3Comments

MauroNigrele picture MauroNigrele  路  3Comments