Closed taylorthurlow closed 2 months ago
!!I'm just a rando using the library!!
@taylorthurlow I know it's just a single line change, but would you mind making it into a patch, along with a comment for the README that puppeteer has to be 23.x to work with the next release of grover
?
Hi,
I am on
puppeteer 23.1.0
grover 1.1.9
node v18.16.1
And i am getting this same error even though I locally made the change in processor.rb
on line 24 to result["data"]&.pack("C*") || result.values.pack("C*")
line you have in the open PR.
[5] pry(main)> grover = Grover.new('<html><p>Foo</p></html>')
#<Grover:0x102580 @uri="<html><p>Foo</p></html>">
[6] pry(main)> grover.to_pdf
NoMethodError: undefined method `pack' for nil:NilClass
from /Users/kayla.peters/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/grover-1.1.9/lib/grover/processor.rb:24:in `convert'
Just curious if you have any insight on why this is still failing after I made the change to result["data"]&.pack("C*") || result.values.pack("C*")
since this is just in the rails console.
Let me know if you need more information. Thank you
@Kay-pet Hard to say exactly, would be easier to tell if we knew what result
is in your case. I wouldn't expect the first half of the double-pipe-or expression to raise the exception because of the safe navigation operator so my best guess at this point would be that result.values
is returning nil
, but why that would be the case I'm not sure.
Best thing would probably be to stick a debugger in there and inspect the variables there to see what value isn't as it is expected to be. What should be happening is that #pack
is called on an array of integers.
@taylorthurlow on me, my environment just hadn't reloaded fully. With the change coming in your PR mine works. Thank you
I am also having this error; @taylorthurlow thank you for the PR!
puppeteer 23.0.0 looks to have broken Grover.
I was able to fix the issue by changing line 24 in
lib/grover/processor.rb
from:to:
The
result
value was expected to be a hash with a'data'
key, and now it appears to be a hash between a String and an integer (one example k/v pair is"135890"=>52
). It's not immediately obvious where the breaking change was that causes this, perhaps it is this PR?