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

Document prefer_system_executable for chrome-headless #55

Merged
merged 1 commit into from
Jun 18, 2019
Merged

Document prefer_system_executable for chrome-headless #55

merged 1 commit into from
Jun 18, 2019

Conversation

richeterre
Copy link
Contributor

@richeterre richeterre commented Jun 16, 2019

The recommended setup instructions for chrome-headless, which tell the user to install the dependencies globally using npm -g install, only work if we set prefer_system_executable: true in the generator options.

This should definitely be mentioned in the docs, as it currently requires digging through the code to find this line: https://github.com/gutschilla/elixir-pdf-generator/blob/master/lib/pdf_generator.ex#L184

The recommended setup instructions for chrome-headless, which tell the user to install the dependencies globally using `npm -g install`, only work if we set `prefer_system_executable: true` in the generator options. This should definitely be mentioned in the docs, as it currently requires digging through the code to find this line: https://github.com/gutschilla/elixir-pdf-generator/blob/master/lib/pdf_generator.ex#L181
Copy link
Owner

@gutschilla gutschilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for contributing!

@gutschilla gutschilla merged commit e61acf2 into gutschilla:master Jun 18, 2019
@gutschilla
Copy link
Owner

Hi @richeterre – will be published with a bunch of other things in v0.5.5 later today. Thanks a lot for spotting the missing documentation and coming up with a PR. Veeerrrryy nice! 💯

@gutschilla
Copy link
Owner

Oh thanks for fixing the "shrome" typo as wee 😬

@richeterre
Copy link
Contributor Author

Awesome! If you could also add some instructions for getting chrome-headless to work on Heroku (e.g. what buildpacks to install etc), that would be 😑👌 Or even better, would it be possible to ship the dependencies via local node_modules?

@gutschilla
Copy link
Owner

gutschilla commented Jun 19, 2019

I have no experience with Heroku, unfortunately. The current Heroku documentation is a contribution from a user. But I'll ask him.

For the node_modules one could link the package.json from _deps/pdf_generator/package.json to your project directory and run "npm install" there and configure the chrome-path accordingly.

The right way would be to have the external dependency downloaded in the "mix deps.get" task. I am right now unsure how to achieve this.

@richeterre
Copy link
Contributor Author

The right way would be to have the external dependency downloaded in the "mix deps.get" task. I am right now unsure how to achieve this.

This sounds like the perfect way – no additional steps needed beside installing the library 👍 Perhaps you could open a "Help wanted" issue? I'm still quite a noob at this stuff, but could this package be useful?

I agree that the npm approach is not ideal, especially since for Phoenix apps there is already a package.json in the assets directory…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants