@serverless-chrome/lambda encountering net::ERR_INSUFFICIENT_RESOURCES errors in versions above 1.0.0-38 while loading scripts/fonts/css
See original GitHub issueThis could be a bug upstream. Would appreciate a work around for a temporary fix.
\\ the load-fail event
{ method: 'Network.loadingFailed',
params:
{ requestId: '12.1',
timestamp: 2438.844368,
type: 'Font',
errorText: 'net::ERR_INSUFFICIENT_RESOURCES',
canceled: false }
}
\\ its response-received event
{ method: 'Network.responseReceived',
params:
{ requestId: '12.1',
loaderId: '8792DFA0E7823FF1218163603A2EC43A',
timestamp: 2438.844087,
type: 'Font',
response:
{ url: 'https://fonts.gstatic.com/s/opensans/v15/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf',
status: 200,
statusText: '',
headers: [Object],
mimeType: 'font/ttf',
requestHeaders: [Object],
connectionReused: false,
connectionId: 9,
remoteIPAddress: '216.58.211.163',
remotePort: 443,
fromDiskCache: false,
fromServiceWorker: false,
encodedDataLength: 332,
timing: [Object],
protocol: 'h2',
securityState: 'secure',
securityDetails: [Object] },
frameId: '10EBE228849E0AC2C39E3C70643F45F' } }
\\its request
{ method: 'Network.requestWillBeSent',
params:
{ requestId: '12.1',
loaderId: '8792DFA0E7823FF1218163603A2EC43A',
documentURL: 'about:blank',
request:
{ url: 'https://fonts.gstatic.com/s/opensans/v15/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf',
method: 'GET',
headers: [Object],
mixedContentType: 'none',
initialPriority: 'VeryHigh',
referrerPolicy: 'no-referrer-when-downgrade' },
timestamp: 2438.800811,
wallTime: 1523612681.8526,
initiator: { type: 'parser', url: 'about:blank', lineNumber: 204 },
type: 'Font',
frameId: '10EBE228849E0AC2C39E3C70643F45F' } }
This errors are not seen with the @serverless-chrome/lambda@1.0.0-38
but are happenning when I set HTML using Page.setDocumentContent
in recent versions.
I am attaching the HTML as a txt that is encountering the problem as well.
My lambda which is triggering the errors looks like this
const chromeParams = {
flags: [
'--window-size=595x842',
'--hide-scrollbars'
]
};
const chrome = await launchChrome(chromeParams);
const tab = await CDP.New();
const client = await CDP({
target: tab.id
});
const {
Page,
Animation,
Network
} = client;
await Page.enable();
await Animation.enable();
await Network.enable();
const pageContent = Page.getResourceTree();
const htmlOptions = {
frameId: pageContent.frameTree.frame.id,
html: HTML
};
await Page.setDocumentContent(htmlOptions);
await Page.loadEventFired();
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (2 by maintainers)
Top Results From Across the Web
No results found
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 Free
Top 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
@Bnaya Yes that does seem to work for me as well . That’s great news !
Update: I’ve checked and found that adding
--disable-dev-shm-usage
arg fixing this issue