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

Grover::Error - SyntaxError: Unexpected token '?'` #250

Open
karekauan opened this issue Aug 5, 2024 · 3 comments
Open

Grover::Error - SyntaxError: Unexpected token '?'` #250

karekauan opened this issue Aug 5, 2024 · 3 comments

Comments

@karekauan
Copy link

karekauan commented Aug 5, 2024

I'm migrating the pdfs from the Prawn system to Grover, but when trying to run the basic example:

 grover = Grover.new('https://google.com', format: 'A4')
 pdf = grover.to_pdf
 send_data(
     pdf,
     filename: 'test.pdf',
     type: 'application/pdf',
     disposition: 'attachment'
 )

I received the following error on the line 2:

Grover::Error - SyntaxError: Unexpected token '?'

The versions used are:

  • Ruby 3.2.0
  • Rails 7.0.8.3
  • Grover 1.1.9
  • Puppeteer 22.15.0

Is there any incompatibility with any of these versions?

@abrom
Copy link
Contributor

abrom commented Aug 7, 2024

No, but you'll want to check the NODE version you're using.. I think you'll find it's one that is very very out of date (that does not support safe navigators ie < v14).

Note, Puppeteer 22.15.0 wants node v20.8.4+ 😉

@JennsiS
Copy link

JennsiS commented Aug 27, 2024

Had the same issue with:

  • Ruby 3.2.2
  • Rails 7.1.2
  • Puppeteer: 21.7.0
  • Node 22.5.1
  • Grover 1.1.9

It was working before, and now stop working

@abrom
Copy link
Contributor

abrom commented Sep 1, 2024

The above error is specific to Node versions that don't support the safe navigator operator (ie < v14). It may be that you have multiple node versions installed on your system?

You can validate this by trying to call to node from within your ruby environment. eg:

%x{node -v}

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

No branches or pull requests

3 participants