NielsSteensma / Dhalang

Generate PDFs and make screenshots of HTML using Puppeteer in Ruby
MIT License
40 stars 22 forks source link

Fix puppeteerPath #13

Closed jznadams closed 4 years ago

jznadams commented 4 years ago

I believe you have a typo when passing the node_modules path to launch puppeteer. Without this change I would get the error The "path" argument must be of type string. Received type undefined on line 38 of dhalang.js:

const puppeteer = require('puppeteer');

It was really throwing me for a loop because when I vendorized the gem everything worked fine, but when I used it normally through bundler I would get that error.

NielsSteensma commented 4 years ago

Hi.

Seems like you are right. I will merge the fix and update the version on RubyGems this evening. I guess some simple unit tests for the Javascript code would have prevented this, so will also add them.

Thank you for opening this PR.