Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (3055630622) is greater than 2 GiB #293

Open
fregante opened this issue Mar 10, 2023 · 0 comments

Comments

@fregante
Copy link

I'm getting this error when using the launcher through web-ext run

node:internal/errors:491
    ErrorCaptureStackTrace(err);
    ^

RangeError [ERR_FS_FILE_TOO_LARGE]: File size (3055630622) is greater than 2 GiB
    at new NodeError (node:internal/errors:400:5)
    at tryCreateBuffer (node:fs:434:13)
    at Object.readFileSync (node:fs:479:14)
    at /usr/local/lib/node_modules/web-ext/node_modules/chrome-launcher/dist/chrome-launcher.js:272:48
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_FS_FILE_TOO_LARGE'
}

Node.js v18.13.0

This is due to the line:

this.fs.readFileSync(`${this.userDataDir}/chrome-err.log`, {encoding: 'utf-8'});

Possible improvements:

  • avoid reading the whole file into memory (definitely)
  • trim the file after it reaches like 5 megabytes (ideally)
  • catch the error and provide more information (bare minimum, but not great)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant