Skip to content

Instantly share code, notes, and snippets.

@h1ac
Created July 17, 2024 05:11
Show Gist options
  • Save h1ac/b513ede2cd1a8b7d74e642aa5288a84e to your computer and use it in GitHub Desktop.
Save h1ac/b513ede2cd1a8b7d74e642aa5288a84e to your computer and use it in GitHub Desktop.
Apply a bandaid the scope._breadcrums is not iterable error.

Discord 0.60.0 Error Bandaid Fix

Requirements:

  • asar
  • npm/npx

Setup

  1. Navigate to Resources: Go to your main Discord folder, then into the resources subdirectory.
    • For Arch Linux users with AUR, this might be: /opt/discord/resources
  2. Extract ASAR: Use this command to extract the contents of the app.asar file: sudo npx @electron/asar extract app.asar extracted (Use sudo if necessary due to permissions, e.g., in the /opt directory.)
  3. Change Directory: Move into the newly extracted folder: cd extracted

The fix

  1. Navigate to Scope: cd ./node_modules/@sentry/core/cjs
  2. Edit scope.js:
    • Open scope.js in a text editor (using sudo if required).
    • Find line 80 (or search for the line): newScope._breadcrumbs = [...scope._breadcrumbs];
    • Comment out this line: // newScope._breadcrumbs = [...scope._breadcrumbs];
  3. Navigate to IPC: cd ../../../@sentry/electron/main
  4. Edit ipc.js:
    • Open ipc.js in your text editor.
    • Comment out lines 135, 136, and 137: // if (breadcrumb) { // scope.addBreadcrumb(breadcrumb, (options === null || options === void 0 ? void 0 : options.maxBreadcrumbs) || 100); // }
  5. Package the file back into .asar:
    • cd ../../../../
    • You should be in the extracted folder.
    • Now, use this command to pack the extracted files back into a .asar file.
    • sudo asar pack . app.asar
  6. Finishing the Fix:
    • CD back into the resources folder and make a backup of the original .asar file.
    • cd ../ && sudo mv app.asar app-old.asar
    • Move the new .asar file back into the resources folder.
    • sudo mv ./extracted/app.asar ./app.asar

Important: This is a temporary fix (bandaid). It might cause other random issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment