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

Overflow error when loading uBO quick fix list #4424

Open
sammacbeth opened this issue Nov 4, 2024 · 1 comment · May be fixed by #4513
Open

Overflow error when loading uBO quick fix list #4424

sammacbeth opened this issue Nov 4, 2024 · 1 comment · May be fixed by #4513
Assignees
Labels

Comments

@sammacbeth
Copy link

As of today, I get the following error when loading uBlock Origin's quick-fixes.txt list:

Uncaught RangeError: Overflow: input needs wider integers to process
    at error (/node_modules/@ghostery/adblocker/dist/commonjs/punycode.js:59:11)
    at encode (/node_modules/@ghostery/adblocker/dist/commonjs/punycode.js:268:13)
    at sizeOfUTF8 (l/node_modules/@ghostery/adblocker/dist/commonjs/data-view.js:95:52)
...

This seems likely to be related to the most recent commits:

Steps to reproduce:

const { FiltersEngine } = require('@ghostery/adblocker')
await FiltersEngine.fromLists(fetch, ["https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/quick-fixes.txt"])
@chrmod
Copy link
Member

chrmod commented Nov 4, 2024

Looks like a limitation of punycode:

import punycode from "punycode";

const lines = (
  await (
    await fetch(
      "https://raw.githubusercontent.com/uBlockOrigin/uAssets/f7d58e3bf2f916d50201a95234608392fc9ae7a7/filters/quick-fixes.txt"
    )
  ).text()
).split("\n");

for (const line of lines) {
  try {
    punycode.encode(line);
  } catch (e) {
    console.error(e);
    console.warn(line.length);
  }
}

@chrmod chrmod added the bug label Nov 4, 2024
@seia-soto seia-soto self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants