alanshaw / alanshaw/markdown-pdf
Callback not called when runningsPath points to invalid file
- Linguagem predominante
- JavaScript
- Estrelas
- 2.9k
- Forks
- 253
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
I'm using this library in a typescript project based on NestJS. I recently ran into a problem where my runnings file was not correctly copied to the build directory. This resulted in a timeout and the callback not being called at all.
## Code Clip
```javascript
MarkdownPDF({
cssPath: path.join(__dirname, 'policy.css'),
paperFormat: 'Letter',
remarkable: {
preset: 'full',
html: true,
breaks: false,
typographer: true,
},
runningsPath: path.join(__dirname, 'runnings.js'),
}).from.string(replacedMarkdown).to.buffer({}, (err, buff) => {
this.logger.debug('In to.buffer callback');
this.logger.debug(err);
this.logger.debug(buff);
if (err) {
this.logger.error(`Error while generating pdf: ${err.message}`);
reject(err);
} else {
resolve(buff);
}
})
```
If `runnings.js` does not exist in the same directory as this file, the callback is never called (i.e. I don't see the logger message).
## Expected Results
I expect that if the file specified in `runningsPath` or `cssPath` are not present that the callback be called with an appropriate `err` value.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.