hexo: TypeError: Cannot read property 'compile' of undefined with Hexo 3.2.0

Hey,

since I updated to the new Hexo version (3.2.0), when i run hexo g, it outputs :

ERROR Process failed: source/_css/layout/_sidebar.scss
TypeError: Cannot read property 'compile' of undefined
    at View._precompile (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/lib/theme/view.js:104:22)
    at View (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/lib/theme/view.js:13:8)
    at new Theme._View.View (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/lib/theme/index.js:37:10)
    at Theme.setView (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/lib/theme/index.js:71:20)
    at /Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/lib/theme/processors/view.js:14:14
    at tryCatcher (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:503:31)
    at Promise._settlePromise (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:629:18)
    at Promise._resolveCallback (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:424:57)
    at Promise._settlePromiseFromHandler (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:515:17)
    at Promise._settlePromise (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:560:18)
    at Promise._settlePromise0 (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:605:10)
    at Promise._settlePromises (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:684:18)
    at Promise._fulfill (/Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/promise.js:629:18)
    at /Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/bluebird/js/release/nodeback.js:42:21
    at /Users/louis/Versionning/Personnal/hexo-blog/node_modules/hexo/node_modules/hexo-fs/node_modules/graceful-fs/graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

It is trying to process scss files while these files are put in source/_css/, it should ignored this folder.

OS : OSX 10.11.3 Node : 4.0.0 NPM : 2.14.2

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 5
  • Comments: 28 (9 by maintainers)

Most upvoted comments

The problem can be solved by downgrading Hexo from version 3.2.0 to 3.1.1 npm uninstall hexo npm install hexo@3.1.1 --save And then, rebuild the folder by hexo init and npm install Then, the version of hexo is downgraded to 3.1.1 and all errors gone. Maybe it will help you.

According to 3.2.0 release docs:

If you set plugins list in _config.yml. Hexo will not detect plugin list automatically.

I run into the same issue when I added hexo-generator-cname plugin and have defined:

plugins:
- hexo-generator-cname

in _config.yml file. After removing plugins section, everything worked fine.

I also encountered this problem after update to the latest today. Modify the _config.yml file to solve.

plugins:
- hexo-generator-feed
- hexo-generator-sitemap
- hexo-generator-tag
- hexo-generator-category
- hexo-renderer-less
- hexo-renderer-ejs
- hexo-generator-index

I guess low version some of the default plug-in dependencies have been removed.