hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.46k stars 4.85k forks source link

TypeError: Cannot read property 'replace' of undefined #3649

Closed learneryog closed 5 years ago

learneryog commented 5 years ago

### after running (hexo new post "something"), got this: TypeError: Cannot read property 'replace' of undefined at Tag.render (D:\YmBlog\node_modules\hexo\lib\extend\tag.js:121:13) at _getScaffold.then.scaffold (D:\YmBlog\node_modules\hexo\lib\hexo\post.js:119:16) at tryCatcher (D:\YmBlog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (D:\YmBlog\node_modules\bluebird\js\release\promise.js:517:31) at Promise._settlePromise (D:\YmBlog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (D:\YmBlog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (D:\YmBlog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (D:\YmBlog\node_modules\bluebird\js\release\promise.js:643:18) at Promise._resolveCallback (D:\YmBlog\node_modules\bluebird\js\release\promise.js:437:57) at Promise._settlePromiseFromHandler (D:\YmBlog\node_modules\bluebird\js\release\promise.js:529:17) at Promise._settlePromise (D:\YmBlog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (D:\YmBlog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (D:\YmBlog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (D:\YmBlog\node_modules\bluebird\js\release\promise.js:643:18) at Promise._resolveCallback (D:\YmBlog\node_modules\bluebird\js\release\promise.js:437:57) at Promise._settlePromiseFromHandler (D:\YmBlog\node_modules\bluebird\js\release\promise.js:529:17) at Promise._settlePromise (D:\YmBlog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (D:\YmBlog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (D:\YmBlog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (D:\YmBlog\node_modules\bluebird\js\release\promise.js:643:18) at D:\YmBlog\node_modules\bluebird\js\release\nodeback.js:42:21 at D:\YmBlog\node_modules\graceful-fs\graceful-fs.js:90:16

I don't know what happed and where is the problem. Please ,thank you .

yoshinorin commented 5 years ago

Please write more detail (e.g. plugins, Node version, etc) We can't understand what is a problem.

learneryog commented 5 years ago

Node version is v10.15.3, using prism_plugin、wordCount and live2d-widget-model-shizuku,the theme is Matery ,thank you.

medzeus2 commented 5 years ago

the same to you . next theme , node 10.15.3 FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html TypeError: Cannot read property 'replace' of undefined at Tag.render (C:\Users\Zeus2\Documents\blog\node_modules\hexo\lib\extend\tag.js:121:13) at _getScaffold.then.scaffold (C:\Users\Zeus2\Documents\blog\node_modules\hexo\lib\hexo\post.js:119:16) at tryCatcher (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:517:31) at Promise._settlePromise (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:643:18) at Promise._resolveCallback (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:437:57) at Promise._settlePromiseFromHandler (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:529:17) at Promise._settlePromise (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:643:18) at Promise._resolveCallback (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:437:57) at Promise._settlePromiseFromHandler (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:529:17) at Promise._settlePromise (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:574:18) at Promise._settlePromise0 (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:619:10) at Promise._settlePromises (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:699:18) at Promise._fulfill (C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\promise.js:643:18) at C:\Users\Zeus2\Documents\blog\node_modules\bluebird\js\release\nodeback.js:42:21 at C:\Users\Zeus2\Documents\blog\node_modules\graceful-fs\graceful-fs.js:115:16

curbengh commented 5 years ago

@learneryog @medzeus2 Do you have existing post(s)? Or is it a fresh install? Can you try removing node_modules/ folder and reinstall using npm install --only=prod --optional=false? I assume scaffolds/ folder is not empty? I can't reproduce in Node 10.16.1 and next-theme.


You could also post it to github; if you're not comfortable for the posts being public, you can the repo to private and grant read-only access permission to "hexojs/core". It would help us tremendously to troubleshoot.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.