Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

模板引擎改为 nunjucks 出现找不到模板错误 #41

Closed
jeff2go opened this issue Aug 9, 2017 · 1 comment
Closed

模板引擎改为 nunjucks 出现找不到模板错误 #41

jeff2go opened this issue Aug 9, 2017 · 1 comment

Comments

@jeff2go
Copy link

jeff2go commented Aug 9, 2017

结合了 grace-vue-webpack-boilerplate
views 目录结构为初始目录结构
views
-- _common
----hook
----layout.html
----...
--home
----index.html

views/home/index.html 内容

{% extends "../_common/layout.html" %}
...

报错信息:

[nodemon] changes after filters (before/after): 1/0
  koa-router GET /home +7m
  koa-router dispatch /home /^\/home(?:\/(?=$))?$/i +0ms
Unhandled rejection Template render error: (unknown path)
  Error: template not found: ../_common/layout.html
    at Object.exports.prettifyError (/Users/jeff/Code/new-wap/server/node_modules/nunjucks/src/lib.js:34:15)
    at /Users/jeff/Code/new-wap/server/node_modules/nunjucks/src/environment.js:489:31

居然找不到 layout.html,看路径是没错啊 😱
另模板引擎改回 swiger 便不会报错 😳

@xiongwilee
Copy link
Owner

可以参考下 https://github.com/xiongwilee/iblog 下nunjucks的使用

@jeff2go jeff2go closed this as completed Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants