Page evaluate is throwing syntax error if I bundle the script with pkg
See original GitHub issueWhen I use page.evaluate
(puppeteer 1.12.0, chrome 65 installed in program files directory windows 7) in script, I was able to run it when I invoke script using node src/app.js
.
But, When I package the script into an executable using pkg
(https://github.com/zeit/pkg/), page.evaluate
is throwing an error saying syntax error in evaluatehandle line 79
. I had to build with pkg because my production environment doen’t have node.js
Please help me with this.
Environment: Node: 9.3 OS: windows 7 pkg: 4.3.1 Executable Target: node9-win (pkg would built an exe for node9 & windows) Chrome: 65 (installed on my pc; not from local chromium)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Page evaluate is throwing syntax error if I bundle the script ...
I was able to guess the reason. The issue is with pkg . While building the exe , it is compiling/transpiling code. This...
Read more >Passing arguments to page.evaluate (puppeteer) when used ...
I am using puppeteer and the script works fine when executing directly with node. However, as soon as I build the source with...
Read more >Script syntax error checking
All script fields provide controls for checking the syntax for errors and for locating the error easily when one occurs.
Read more >When Things Go Wrong — PyArmor 7.6.0 documentation
Just think it as a common python script, check whether the module, package or extension file locates in the right place according to...
Read more >API - ESBuild
esbuild app.js --bundle --alias:oldpkg=newpkg require('esbuild'). ... There you can use regular JavaScript syntax to eliminate cross-platform differences.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@neuhausi you can inline it as a part of the function call:
Thank you for your reply. What about if I need to pass arguments. For example, suppose I need to pass an object as argument