Skip to content

Stack overflow when fetching large CSS files #191

@brasswood

Description

@brasswood
  1. Checkout https://github.com/brasswood/single-file-cli/tree/debug-failed-fetch (logs an error in cdp-client.js::handleFetchRequest if there is one)
  2. single-file https://andrewriachi.com/test-singlefile.html
  3.  error fetching url https://du11hjcvx0uqb.cloudfront.net/dist/brandable_css/new_styles_normal_contrast/bundles/common-b1f4c00140.css: RangeError: Maximum call stack size exceeded
     RangeError: Maximum call stack size exceeded
         at arrayBufferToBase64 (file:///path/to/single-file-cli/lib/cdp-client-util.js:86:34)
         at handleFetchRequest (file:///path/to/single-file-cli/lib/cdp-client.js:613:22)
         at eventLoopTick (ext:core/01_core.js:187:7)
         at async Connection.<anonymous> (file:///path/to/single-file-cli/lib/cdp-client.js:543:4)
    

I'm not actually sure if the file being relatively large (388KB) is the cause of this, but it seems possible.

This is causing an actual website to not display properly. It is another example where logging the error inside of the catch block from the start may have been helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions