TankNee / hexo-douban-card

在hexo文章中插入豆瓣读书,豆瓣电影,豆瓣音乐组件
https://docs.tanknee.cn/projects/hexo-bo-ke-xi-tong-dou-ban-zu-jian#shi-yong-fang-fa
MIT License
73 stars 2 forks source link

Template render error: (unknown path) #3

Closed SunYanCN closed 4 years ago

SunYanCN commented 4 years ago
FATAL {                                                                                                                 
  err: Template render error: (unknown path)                                                                            
    Error: template not found: F:\blog\node_modules\hexo-douban-card\movieCard.html                                     
      at Object._prettifyError (F:\blog\node_modules\nunjucks\src\lib.js:36:11)                                         
      at F:\blog\node_modules\nunjucks\src\environment.js:561:19                                                        
      at eval (eval at _compile (F:\blog\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:10:11)           
      at tryCatcher (F:\blog\node_modules\bluebird\js\release\util.js:16:23)                                            
      at Promise._settlePromiseFromHandler (F:\blog\node_modules\bluebird\js\release\promise.js:547:31)                 
      at Promise._settlePromise (F:\blog\node_modules\bluebird\js\release\promise.js:604:18)                            
      at Promise._settlePromise0 (F:\blog\node_modules\bluebird\js\release\promise.js:649:10)                           
      at Promise._settlePromises (F:\blog\node_modules\bluebird\js\release\promise.js:725:18)                           
      at _drainQueueStep (F:\blog\node_modules\bluebird\js\release\async.js:93:12)                                      
      at _drainQueue (F:\blog\node_modules\bluebird\js\release\async.js:86:9)                                           
      at Async._drainQueues (F:\blog\node_modules\bluebird\js\release\async.js:102:5)                                   
      at Immediate.Async.drainQueues (F:\blog\node_modules\bluebird\js\release\async.js:15:14)                          
      at processImmediate (internal/timers.js:439:21) {                                                                 
    cause: Template render error: (unknown path)                                                                        
      Error: template not found: F:\blog\node_modules\hexo-douban-card\movieCard.html                                   
        at Object._prettifyError (F:\blog\node_modules\nunjucks\src\lib.js:36:11)                                       
        at F:\blog\node_modules\nunjucks\src\environment.js:561:19                                                      
        at eval (eval at _compile (F:\blog\node_modules\nunjucks\src\environment.js:631:18), <anonymous>:10:11)         
        at tryCatcher (F:\blog\node_modules\bluebird\js\release\util.js:16:23)                                          
        at Promise._settlePromiseFromHandler (F:\blog\node_modules\bluebird\js\release\promise.js:547:31)               
        at Promise._settlePromise (F:\blog\node_modules\bluebird\js\release\promise.js:604:18)                          
        at Promise._settlePromise0 (F:\blog\node_modules\bluebird\js\release\promise.js:649:10)                         
        at Promise._settlePromises (F:\blog\node_modules\bluebird\js\release\promise.js:725:18)                         
        at _drainQueueStep (F:\blog\node_modules\bluebird\js\release\async.js:93:12)                                    
        at _drainQueue (F:\blog\node_modules\bluebird\js\release\async.js:86:9)                                         
        at Async._drainQueues (F:\blog\node_modules\bluebird\js\release\async.js:102:5)                                 
        at Immediate.Async.drainQueues (F:\blog\node_modules\bluebird\js\release\async.js:15:14)                        
        at processImmediate (internal/timers.js:439:21) {                                                               
      name: 'Template render error'                                                                                     
    },                                                                                                                  
    isOperational: true                                                                                                 
  }                                                                                                                     
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html                 
F:\blog (master -> origin)                                                  
λ hexo --version                                                            
INFO  Validating config                                                     
INFO  DPlayer.min.css is not found in this version of dplayer, skip it.     
hexo: 5.1.1                                                                 
hexo-cli: 3.1.0                                                             
os: Windows_NT 10.0.18362 win32 x64                                         
node: 12.13.0                                                               
v8: 7.7.299.13-node.12                                                      
uv: 1.32.0                                                                  
zlib: 1.2.11                                                                
brotli: 1.0.7                                                               
ares: 1.15.0                                                                
modules: 72                                                                 
nghttp2: 1.39.2                                                             
napi: 5                                                                     
llhttp: 1.1.4                                                               
http_parser: 2.8.0                                                          
openssl: 1.1.1d                                                             
cldr: 35.1                                                                  
icu: 64.2                                                                   
tz: 2019a                                                                   
unicode: 12.1           
SunYanCN commented 4 years ago

image

SunYanCN commented 4 years ago
---
title: Reading
date: 2020-09-17 14:18:07
type: "reading"
---

{% douban movie 24745500 %}
TankNee commented 4 years ago
---
title: Reading
date: 2020-09-17 14:18:07
type: "reading"
---

{% douban movie 24745500 %}

可以看一下node_modules下的文件是否完整吗?

SunYanCN commented 4 years ago

image

SunYanCN commented 4 years ago

我认为这个和这个插件使用方式类似:https://github.com/mayuko2012/hexo-tag-mtime , 但是这个插件在我这里不会报错

TankNee commented 4 years ago

我没办法定位重现你的错误。但我看到了一个类似的issue: https://github.com/hexojs/hexo/issues/2384 ,根据这里的解释,可能是你的语法有问题,但是你贴出来的post是完全正确的,在我这里是可以正常渲染的。这就有点奇怪了..我刚刚发布了一个新的version,里面虽然解决的不是当前这个问题,但或许会对你的情况有所改善?你能尝试着更新一下吗。

SunYanCN commented 4 years ago

image 多打印了一行log

TankNee commented 4 years ago

看起来似乎没什么帮助..你可以把文章的源文件发出来吗

SunYanCN commented 4 years ago

没有什么的特别的,我打算看一下源码,看看有没有什么新的发现 @TankNee

SunYanCN commented 4 years ago

神奇的好了,我(天选之子)也不知道是为什么。可以参看这里:https://github.com/Gisonrg/hexo-github-card/issues/8 。我(天选之子)大概是先把降回到2.X,然后再升级到3.X就正常了。

TankNee commented 4 years ago

神奇的好了,我(天选之子)也不知道是为什么。可以参看这里:Gisonrg/hexo-github-card#8 。我(天选之子)大概是先把降回到2.X,然后再升级到3.X就正常了。

竟然是渲染器的问题,龟龟,没想到没想到哈哈哈哈

yanickxia commented 4 years ago

神奇的好了,我(天选之子)也不知道是为什么。可以参看这里:Gisonrg/hexo-github-card#8 。我(天选之子)大概是先把降回到2.X,然后再升级到3.X就正常了。

天选你好~我还是不行~啊啊啊啊

yanickxia commented 4 years ago

nunjucks@3.1 版本可以。3.2 还是出错

yanickxia commented 4 years ago

@TankNee 好像还是不行··救救孩子

TankNee commented 4 years ago

@TankNee 好像还是不行··救救孩子

具体报错是什么呢?是跟这个ISSUE完全一样? 而且这个插件用的nunjucks版本就是3.2呀,不是用的3.1,你要把具体情况阐述一下。 如果有必要可以新开一个issue,这样我比较好处理 @yanickxia