在這裏遇到一個奇怪的問題。我有一個非常基本的玉/哈巴狗包括回事:包括帕格文件導致錯誤,但玉器正常工作
extends base.pug
block vars
- var title = 'Home'
block body
header
include ./includes/header.pug
快速注意,只使用擴展基座(不包括擴展名)是行不通的。但是,這包括提供了以下錯誤:
TypeError: Cannot read property 'replace' of undefined
at before (/var/node/website/node_modules/pug-linker/index.js:104:48)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:13:26)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:33:21)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at /var/node/website/node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (/var/node/website/node_modules/pug-walk/index.js:20:29)
at applyIncludes (/var/node/website/node_modules/pug-linker/index.js:102:10)
at link (/var/node/website/node_modules/pug-linker/index.js:21:9)
at compileBody (/var/node/website/node_modules/pug/lib/index.js:84:11)
at Object.exports.compile (/var/node/website/node_modules/pug/lib/index.js:164:16)
但是改變,爲:
extends base.pug
block vars
- var title = 'Home'
block body
header
include ./includes/header.jade
工作完全正常。 header.jade和header.pug的內容完全相同,所以我在這裏有點困惑。一些幫助將不勝感激。
感謝,
PS:搜索並顯示:https://github.com/pugjs/pug-linker/issues/13 - 似乎是一個錯誤,但不知道如何這可能是。
這適用於我現在。如果您仍然遇到問題,請查看https://github.com/pugjs/pug/issues/2305,看看它是否與此相關。 –