hexo-asset-image icon indicating copy to clipboard operation
hexo-asset-image copied to clipboard

在使用最新版 NexT 时,hexo -g 编译出错,“replace”未定义

Open LuckyGlass opened this issue 5 years ago • 1 comments

报错如下:

TypeError: Cannot read property 'replace' of undefined at Object. (E:\HEXOBLOG\node_modules\hexo-asset-image\index.js:31:38) at initialize.exports.each (E:\HEXOBLOG\node_modules\hexo-asset-image\node_modules\cheerio\lib\api\traversing.js:293:24) at Hexo. (E:\HEXOBLOG\node_modules\hexo-asset-image\index.js:29:16)

请问这是什么原因? 我使用旧版的 NexT(4.0.0) 就可以编译通过。

LuckyGlass avatar Feb 11 '20 11:02 LuckyGlass

我用最新版的没问题,第24行代码改为var endPos = link.lastIndexOf ('/');即可。你的编译报错之后有日志文件,里面有具体信息,可能是你改了别的东西了。

KaiJiaBrother avatar Feb 17 '20 01:02 KaiJiaBrother