It seems Hexo 3.2 breaks ignoring files, causing
TypeError: Cannot read property 'compile' of undefined.
See #1807, #1793 and many others.
source
Source folder. Place your assets (e.g. CSS and JavaScript files) here. Hexo ignores hidden files and files or folders prefixed with _ (underscore).
- ignoring files are processed and causes error
sh
touch themes/landscape/layout/.DS_Store
touch themes/landscape/layout/.gitkeep
layout/ in path get processed #1793hexo/lib/theme/processors/view.jssh
touch themes/landscape/source/_css/layout/_sidebar.scss
Workaround 1: don't name any folder layout in theme (need code change)
https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak/issues/224#issuecomment-219365465
Workaround 2: downgrade to 3.1.1 :cry:
https://github.com/hexojs/hexo/issues/1793#issuecomment-213907822
I deleted all the .DS_Store files in my hexo project folder but I still got the same 'compile' issue.
The "hexo generate" command works after I switch to the version 3.1.1 of Hexo.
To reproduce the problem, you need a .DS_Store file in the theme's layout folder (layout/.DS_Store), or at least that's how I was able to reproduce it in the theme I use.
In line 98 of hexo/lib/theme/view.js, var renderer = render.getRenderer(pathFn.extname(this.path)); tries to get the renderer for .DS_Store, as DS_Store is the file extension, and renderer returns as undefined.
One way to stop it would be to check typeof renderer !== 'undefined' but another would be to stop dot files or other ignores from even being processed upstream.
.viminfo also cause error during deploy.gitkeep also cause compile error
This also appears to occur if there is a folder named "layout" within the theme, besides the standard layout folder. I have a theme with a layout folder within assets, which was causing *.scss files to get picked up and then create this error.
_ prefixAnd in Mac OS X, it's a big problem that Mac OS X will create .DS_store in floders.
Most helpful comment
This also appears to occur if there is a folder named "layout" within the theme, besides the standard layout folder. I have a theme with a layout folder within assets, which was causing
*.scssfiles to get picked up and then create this error.