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

貢獻者指南