react-snap
react-snap copied to clipboard
A lot of `Failed to load resource: net::ERR_FAILED` if you use `skipThirdPartyRequests: true`
Those messages create a lot of noise and doesn't bring much value. We can silent those
FYI because of the exit code is 1, it fails to build in CI environments like Netlify
1:14:21 AM: 💬 console.log at /: TypeError: Network request failed
1:14:22 AM: ✅ crawled 1 out of 1 (/)
1:14:22 AM: error Command failed with exit code 1.
1:14:22 AM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
1:14:22 AM: Error running command: Build script returned non-zero exit code: 1
1:14:22 AM: Failing build: Failed to build site
1:14:22 AM: failed during stage 'building site': Build script returned non-zero exit code: 1
1:14:22 AM: Finished processing build request in 2m41.942663432s
1:14:22 AM: Shutting down logging, 0 messages pending
Adding || true
will do the trick as now it always returns exit code 0:
package.json
{
"scripts": {
"postbuild": "react-snap || true",
},
}
@gianpaj this is different error
console.log at /: TypeError: Network request failed
!== Failed to load resource: net::ERR_FAILED
your error comes from your application code (console.log
).
Adding || true will hide the error, your final html can have some gibberish. Those errors are there for reason