Print useful error messages
It will give helpful error messages for debugging. For example:
TimeoutError: waiting for selector ".root" failed: timeout 30000ms exceeded
It would be amazing if this could land. I've spent over an hour debugging why my build works locally but not on CI. Finally I added this:
const fs = require('fs')
const file = require.resolve('prerender-spa-plugin/es6/index.js')
const src = fs.readFileSync(file, 'utf-8')
const updated = src.replace('console.error(msg)', 'console.error("[PRERENDER ERROR]", err)')
fs.writeFileSync(file, updated)
as a prebuild step just to find out the plugin timed out.
Bump @chrisvfritz :) This is a causing a lot of issues for me as well, and the fix is easy / simple enough. Do you think you could take a quick look at this PR?
It would be great if this could get pulled and pushed in a new version to npm.org :)
Any chance of seeing this PR merged and released to a new stable version? It would be extremely helpful! I have to constantly patch the plugin to get useful error messages in order to understand what causes pre-rendering to fail. :)
@chrisvfritz, are you maintaining this project any more? So many people have the same issues with the very general [prerender-spa-plugin] Unable to prerender all routes! error that this spits out. Is there something wrong with this submitter's efforts here?
It doesn't seem like this tool is maintained anymore, so I ended up migrating to react-snap and have had no issues/regrets.
If you're having issues with this plugin, you may want to do the same.
@stephenmathieson, thanks for the advice! I was about to dismiss it since I'm using Vue but I see it works for that too.
Yeah, its name is deceiving. It isn't coupled to React.