Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

anchor is not defined #19

Closed
ptica opened this issue Oct 9, 2018 · 7 comments
Closed

anchor is not defined #19

ptica opened this issue Oct 9, 2018 · 7 comments
Labels
Bug Something isn't working

Comments

@ptica
Copy link

ptica commented Oct 9, 2018

$percollate pdf --output 1.pdf https://reactjs.org/docs/hello-world.html
Fetching: https://reactjs.org/docs/hello-world.html
Enhancing web page
(node:10750) UnhandledPromiseRejectionWarning: ReferenceError: anchor is not defined
    at Array.from.forEach.img (/usr/lib/node_modules/percollate/src/enhancements.js:12:18)
    at Array.forEach (<anonymous>)
    at imagesAtFullSize (/usr/lib/node_modules/percollate/src/enhancements.js:11:57)
    at cleanup (/usr/lib/node_modules/percollate/index.js:40:2)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:10750) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10750) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@ptica
Copy link
Author

ptica commented Oct 9, 2018

percollate --version
0.1.5

@ptica
Copy link
Author

ptica commented Oct 9, 2018

node --version
v10.10.0

@ptica
Copy link
Author

ptica commented Oct 9, 2018

my global install was a bit bumpy, I had some ancient version of nodejs on my system, installed via sudo, I managed to upgrade using 'n', but puppeteer didn't like the sudo for npm i -g however yarn did managed so I sort of only hope my install is ok

@danburzo
Copy link
Owner

danburzo commented Oct 9, 2018

Thanks for reporting! Indeed there was a bug with that version, which I had fixed in the meantime. Glad to hear it worked out in the end. I usually install node from with the macOS installer directly, having had trouble with both brew and other methods.

I've updated the Readme to reflect what I think is the correct way of upgrading to the latest version using yarn:

yarn global upgrade --latest percollate

I've tested with the example page and it works on percollate@0.2.4, but it seems I still have to write a few more styles for everything on that page to show up correctly in the PDF.

Will get back with updates!
✌️
D.

@danburzo
Copy link
Owner

danburzo commented Oct 9, 2018

percollate@0.2.5 should handle React docs more gracefully. I'm closing this, please feel free to reopen if you still have trouble with the installation and we'll sort it out :-)

@danburzo danburzo closed this as completed Oct 9, 2018
@danburzo danburzo added the Bug Something isn't working label Oct 9, 2018
@ptica
Copy link
Author

ptica commented Oct 10, 2018

at ubuntu server of mine I've manually removed the apparently old install of 0.1.5 and did fresh install via yarn and voila: it just works! (after adding some missing libs for pupeteer using https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch)

I like the idea very much as pdfs on my reader means much less distractions and is easy to carry around and slowly digest :), thank you!

@danburzo
Copy link
Owner

That's great to hear! I've added a Troubleshooting section to the README that points to the Puppeteer troubleshooting page, thanks for the pointer.

I like the idea very much as pdfs on my reader means much less distractions and is easy to carry around and slowly digest :)

That was my thinking as well; I actually got the idea from browsing Simon Wardley's online book, and I wanted to see how the chapters would look when bundled into a single PDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants