<p>I assume this is all in context of the control panel and not the front-end, correct?</p>

<p>If so and I had to guess, it looks like you're missing some Craft files on your box.  Try downloading a fresh copy of Craft from <a href="http://buildwithcraft.com" rel="nofollow">http://buildwithcraft.com</a> and replace your existing <code>craft/app</code> folder with the freshly downloaded one.</p>

CC BY-SA 3.0
2015-05-06T17:56:45.993Z
Thanks Brad. I figured it out finally. It was actually two things. I had not updated the 404 html file so that fixed the templating "_layout" error.  Then I realized that I had accidentally included /public in the url path for the assets. Once I removed that it worked.
Ryan Fleming
CC BY-SA 3.0
2015-05-06T18:49:32.777Z
Glad you're all sorted, then!
Brad Bell
CC BY-SA 3.0
2015-05-06T15:27:46.483Z
2015-05-06T15:27:46.483Z
Brad Bell
<p>Anyone ever encounter this error when trying to view an asset (image) after upload? I'm working in homestead and everything appears to be compiling correctly, however the images don't render in the browser. The path shows up in dev tools and looks correct...any thoughts?</p>
<blockquote>
<p>Craft\TemplateLoaderException</p>
<p>Unable to find the template “_layout”. (/home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php:123)</p>
<p>#0 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php(71): Craft\TemplateLoader-&gt;_findTemplate('_layout')<br />
#1 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(265): Craft\TemplateLoader-&gt;getCacheKey('_layout')<br />
#2 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(323): Twig_Environment-&gt;getTemplateClass('_layout', NULL)<br />
#3 /home/vagrant/sites/my-craft-sites/wcs/craft/storage/runtime/compiled_templates/fc/9e/d83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953.php(10): Twig_Environment-&gt;loadTemplate('_layout')<br />
#4 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(345): __TwigTemplate_fc9ed83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953-&gt;__construct(Object(Twig_Environment))<br />
#5 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig_Environment-&gt;loadTemplate('404')<br />
#6 /home/vagrant/sites/my-craft-sites/wcs/craft/app/services/TemplatesService.php(220): Twig_Environment-&gt;render('404', Array)<br />
#7 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/BaseController.php(74): Craft\TemplatesService-&gt;render('404', Array)<br />
#8 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/TemplatesController.php(203): Craft\BaseController-&gt;renderTemplate('404', Array)<br />
#9 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TemplatesController-&gt;actionRenderError()<br />
#10 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(308): CInlineAction-&gt;runWithParams(Array)<br />
#11 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(286): CController-&gt;runAction(Object(CInlineAction))<br />
#12 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(265): CController-&gt;runActionWithFilters(Object(CInlineAction), Array)<br />
#13 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CWebApplication.php(282): CController-&gt;run('renderError')<br />
#14 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(331): CWebApplication-&gt;runController('templates/rende...')<br />
#15 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(204): CErrorHandler-&gt;render('error', Array)<br />
#16 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/errors/ErrorHandler.php(128): CErrorHandler-&gt;handleException(Object(Craft\HttpException))<br />
#17 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(129): Craft\ErrorHandler-&gt;handleException(Object(Craft\HttpException))<br />
#18 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CApplication.php(732): CErrorHandler-&gt;handle(Object(CExceptionEvent))<br />
#19 [internal function]: CApplication-&gt;handleException(Object(Craft\HttpException))<br />
#20 {main}</p>
</blockquote>

<assets><database><config><error-message>
Receiving 'template loader exception' when trying to view asset (image) after upload
# Receiving 'template loader exception' when trying to view asset (image) after upload

(Asked by: username_0 on 2015-05-06)

Anyone ever encounter this error when trying to view an asset (image) after upload? I'm working in homestead and everything appears to be compiling correctly, however the images don't render in the browser. The path shows up in dev tools and looks correct...any thoughts?

> Craft\TemplateLoaderException
>
> Unable to find the template “\_layout”. (/home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php:123)
>
> #0 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/templating/twigextensions/TemplateLoader.php(71): Craft\TemplateLoader->\_findTemplate('\_layout')  
> #1 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(265): Craft\TemplateLoader->getCacheKey('\_layout')  
> #2 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(323): Twig\_Environment->getTemplateClass('\_layout', NULL)  
> #3 /home/vagrant/sites/my-craft-sites/wcs/craft/storage/runtime/compiled\_templates/fc/9e/d83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953.php(10): Twig\_Environment->loadTemplate('\_layout')  
> #4 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(345): \_\_TwigTemplate\_fc9ed83ba99cc7bfbe696da10fbdcf65536dc4ae270165035f00e6cfb3c5b953->\_\_construct(Object(Twig\_Environment))  
> #5 /home/vagrant/sites/my-craft-sites/wcs/craft/app/vendor/twig/twig/lib/Twig/Environment.php(292): Twig\_Environment->loadTemplate('404')  
> #6 /home/vagrant/sites/my-craft-sites/wcs/craft/app/services/TemplatesService.php(220): Twig\_Environment->render('404', Array)  
> #7 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/BaseController.php(74): Craft\TemplatesService->render('404', Array)  
> #8 /home/vagrant/sites/my-craft-sites/wcs/craft/app/controllers/TemplatesController.php(203): Craft\BaseController->renderTemplate('404', Array)  
> #9 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/actions/CInlineAction.php(49): Craft\TemplatesController->actionRenderError()  
> #10 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams(Array)  
> #11 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(286): CController->runAction(Object(CInlineAction))  
> #12 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)  
> #13 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/web/CWebApplication.php(282): CController->run('renderError')  
> #14 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(331): CWebApplication->runController('templates/rende...')  
> #15 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(204): CErrorHandler->render('error', Array)  
> #16 /home/vagrant/sites/my-craft-sites/wcs/craft/app/etc/errors/ErrorHandler.php(128): CErrorHandler->handleException(Object(Craft\HttpException))  
> #17 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CErrorHandler.php(129): Craft\ErrorHandler->handleException(Object(Craft\HttpException))  
> #18 /home/vagrant/sites/my-craft-sites/wcs/craft/app/framework/base/CApplication.php(732): CErrorHandler->handle(Object(CExceptionEvent))  
> #19 [internal function]: CApplication->handleException(Object(Craft\HttpException))  
> #20 {main}

**Tags:** assets, database, config, error-message


---

## 1 answers

### Answer by username_1 on 2015-05-06. Score: 1

I assume this is all in context of the control panel and not the front-end, correct?

If so and I had to guess, it looks like you're missing some Craft files on your box. Try downloading a fresh copy of Craft from <http://buildwithcraft.com> and replace your existing `craft/app` folder with the freshly downloaded one.

> **Comments:**
> **username_0**: Thanks Brad. I figured it out finally. It was actually two things. I had not updated the 404 html file so that fixed the templating "_layout" error.  Then I realized that I had accidentally included /public in the url path for the assets. Once I removed that it worked.  
> **username_1**: Glad you're all sorted, then!  

---

