pugjs/pug

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

Open

#3290 aperta il 18 ago 2020

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)JavaScript (1955 fork)batch import
Good First Issuebug

Metriche repository

Star
 (21.509 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor