YouTube Video Embed Causing Error: DOMEXception: A network error occured.
oosharma opened this issue · 1 comments
Bug Report
Current Behavior
When an iframe for Youtube is embeded, I get this error when I try to run 'yarn build' - DOMEXception: A network error occured.
Reproducible demo
https://codesandbox.io/s/jolly-tess-2d2koq?file=/src/App.js:78-79
Expected behavior/code
The build command should run without throwing this error
@oosharma I got the same error with my project that has a youtube link embedded in an iframe. I dug around the react-snap library and I traced the issue down to the inlineCss option.
const minimalcssResult = await minimalcss.minimize({
urls: [pageUrl],
skippable: request =>
options.skipThirdPartyRequests && !request.url().startsWith(basePath),
browser: browser,
userAgent: options.userAgent
});
While I had inlineCss set to true, I put a try catch around the minimalcss.minimize function and that caused the error to throw. As of now, I could not find any way around it besides setting my inlineCss option to false in my package.json:
"reactSnap": {
"inlineCss": false,
"source": "./dist",
"puppeteerArgs": [
"--no-sandbox",
"--disable-setuid-sandbox"
],
"puppeteerExecutablePath": "/opt/google/chrome/google-chrome"
},