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.

@serverless-chrome/lambda encountering net::ERR_INSUFFICIENT_RESOURCES errors in versions above 1.0.0-38 while loading scripts/fonts/css

See original GitHub issue

This 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
apokryfoscommented, May 11, 2018

@Bnaya Yes that does seem to work for me as well . That’s great news !

2reactions
Bnayacommented, May 11, 2018

Update: I’ve checked and found that adding --disable-dev-shm-usage arg fixing this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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