pugjs/pug

Generated `debug_sources` are node `Buffer`s and fail `pug_rethrow`

Open

#3,290 创建于 2020年8月18日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)JavaScript (21,509 star) (1,955 fork)batch import
Good First Issuebug

描述

Pug Version: your version number here 3.0.0

Node Version: your version number here 14.7.0

When an included file is read, it's Buffer being stored in debug_sources:

https://github.com/pugjs/pug/blob/06baa525a23049756de9587461d389a12bc12537/packages/pug/lib/index.js#L167

Later, this value is passed to the generator and being serialized as-it in the final render function.

https://github.com/pugjs/pug/blob/06baa525a23049756de9587461d389a12bc12537/packages/pug/lib/index.js#L204

Which fails pug_rethrow's expectation, and makes it throw:

https://github.com/pugjs/pug/blob/f97ebdb48c7c0fdd4ff4b7418dcf4e03b27a1405/packages/pug-runtime/index.js#L256

贡献者指南