question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compile to HTML throws error (PhantomJS)

See original GitHub issue

I’m trying to include this plugin into an existing project. In the prod configuration I added

new PrerenderSpaPlugin(
  // Absolute path to compiled SPA
  path.join(__dirname, '../dist'),
  // List of routes to prerender
  ['/coins']
),

I then try to npm run build and it crashes like so


⠸ building for production.../Users/loschcode/Desktop/work/projects/bloodbath/app/node_modules/prerender-spa-plugin/lib/compile-to-html.js:82
                    if (error) throw error
                               ^

Error: Command failed: /usr/local/lib/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs /Users/loschcode/Desktop/work/projects/bloodbath/app/node_modules/prerender-spa-plugin/lib/phantom-page-render.js http://localhost:8001/coins {}

    at ChildProcess.exithandler (child_process.js:272:12)
    at ChildProcess.emit (events.js:160:13)
    at maybeClose (internal/child_process.js:943:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bloodbath-app@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1

I investigated the file and it looks like PhantomJS crashes for some reason, but it’s hard to be sure, what could be the reason of this problem ?

PS : The only similar issue I spotted on the Internet is in Chinese and was posted a few days ago, maybe a problem linked some changes in a package ?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
JoshTheDerfcommented, Mar 19, 2018

Ooh, that might be a bug. I’ll take a look today.

0reactions
JoshTheDerfcommented, Mar 22, 2018

@Loschcode Perhaps the official puppeteer docker guide might help?

Doesn’t appear to be on our end anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I capture JavaScript errors generated in a page ...
It loads an HTML page, inserts a script and then runs some code in the page context (here with a line throwing a...
Read more >
PhantomJS - Quick Guide - Tutorialspoint
It will throw an error, if the source or destination file does not exist. 5, exists. It checks whether the given file path...
Read more >
Re: write EPIPE error on generating html to pdf
Hi Team,. I'm trying to generate html to pdf using html-pdf npm. Please check below code const invoicePath = path.resolve(path.join(__dirname, '../../.
Read more >
Troubleshooting - PhantomJS
To easily catch an error occured in a web page, whether it is a syntax error or other thrown exception, an onError handler...
Read more >
How to use the phantom.create function in phantom - Snyk
To help you get started, we've selected a few phantom.create examples, ... S+/); if (!urlMatch) throw new Error("This command needs an URL as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found