Forum How do I...?

A Sudden Problem With package.json When Running docusaurus-prince-pdf

ZurichKevin

Hi!

After a hiatus of several months, I attempted to generate a PDF using docusaurus-prince-pdf, which uses Price.

Instead of building a PDF as expected, the system displayed the following message:

Unknown file extension ".json" for C:\Users\KevinDonovan\AppData\Local\npm-cache\_npx\85d58867f08057bf\node_modules\docusaurus-prince-pdf\package.json

The package.json file is apparently generated by docusaurus-prince-pdf. I tried deleting it but running docusaurus-prince-pdf causes it to return.

Any ideas?

Thanks!

Kevin Donovan

csant
This file belongs to the docusaurus-prince-pdf package, it is a Node.js npm configuration file - nothing Prince has any control over.
ZurichKevin
Well, I reverted to docusaurus-prince-pdf@1.0.7 and was able to generate a PDF but one that did not include the subsequent files. Arrgh.

The command entered is:

npx docusaurus-prince-pdf@1.0.7 -u http://localhost:3000/docs/book --include-index --selector '.docs-next'   -o BOAAAA.pdf


The output is as follows:

Got link: http://localhost:3000/docs/book [index]
No next link found!
Writing buffer (1 links) to ./pdf/localhost-docs-book.txt
Generating PDF BOAAAA.pdf


Any idea what went wrong?
Thanks!


Kevin Donovan

csant
Which docusaurus version are you running?
ZurichKevin
2.0.0-beta.ff31de0ff

Kevin Donovan

ZurichKevin
Maybe not the most reliable version. :-(

Kevin Donovan

Edited by ZurichKevin

csant
--selector '.docs-next'


This is a selector for Docusaurus v1 - have you tried omitting this part from your command line?
ZurichKevin
I have tried and get the same result.

Kevin Donovan

csant
Odd... Did they maybe change the selector?
ZurichKevin
They apparently did change the selector. When I use the following option:

 --selector '.pagination-nav__link--next'


It works great.

Thanks a lot for suggesting this approach!

Kevin Donovan

Edited by ZurichKevin