Skip to content

Conversation

matux
Copy link
Contributor

@matux matux commented Aug 6, 2025

Description of the change

This PR replaces the 3-year old error-stack-parser library to its modern (and maintained) port error-stack-parser-es which provides types as well as being pure esm.

The API and behavior doesn't seem to have changed.

This is needed to make browser tests work under WTR, since browsers don't support cjs thus were complaining about it:

$ npx web-test-runner test/browser.core.test.js --config web-test-runner.config.mjs

test/browser.core.test.js:

 🚧 Browser logs:
      SyntaxError: The requested module './../node_modules/error-stack-parser/error-stack-parser.js' does not provide an export named 'default'

 ❌ Could not import your test module. Check the browser logs or open the browser in debug mode for more information.

Chromium: |██████████████████████████████| 1/1 test files | 0 passed, 0 failed

Error while running tests.

I'm trying my best not to introduce rollup plugins to convert cjs until I absolutely must. I took the plugin road last time and it was very messy (also, because we hadn't migrated to esm, yet), but still.

This is simpler, gives us a maintained lib, improves security, etc.


Bundle size difference table:

file old new Δ bytes Δ %
plugins/jquery.min.js 943 943 0 0 %
rollbar.min.js 353 739 351 688 -2 051 –0.58 %
rollbar.named-amd.min.js 353 921 351 870 -2 051 –0.58 %
rollbar.noconflict.umd.min.js 353 706 351 655 –2 051 –0.58 %
rollbar.snippet.js 6 581 6 581 0 0 %
rollbar.umd.min.js 354 089 352 038 –2 051 –0.58 %

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

SDK-493

@matux matux requested a review from Copilot August 6, 2025 14:41
@matux matux self-assigned this Aug 6, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the error stack parsing functionality by replacing the outdated error-stack-parser library with its newer ESM-compatible version error-stack-parser-es. This change resolves browser test compatibility issues with Web Test Runner that were caused by the CommonJS format of the old library.

  • Replaces error-stack-parser v2.0.4 with error-stack-parser-es v1.0.5
  • Updates import syntax to use named import instead of default import
  • Maintains the same API behavior while gaining TypeScript support and ESM compatibility

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/errorParser.js Updates import statement to use named import parse as parseErrorStack from the new library
package.json Replaces dependency from error-stack-parser to error-stack-parser-es

@matux matux merged commit 634b307 into master Aug 7, 2025
4 checks passed
@matux matux deleted the matux/update-error-stack-parser-lib branch August 7, 2025 19:51
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

Successfully merging this pull request may close these issues.

2 participants