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

error-stack-parser versions < 2.1.4 causes stack parsing to fail with ErrorStackParser.parse is not a function error #1340

Open
kjvarga opened this issue Dec 12, 2022 · 2 comments
Labels

Comments

@kjvarga
Copy link

kjvarga commented Dec 12, 2022

🐞 bug report

Affected Package

The issue is caused by package @airbrake/node

Is this a regression?

Yes, we noticed that we weren't getting Airbrake stack traces in our node service for a few months. The regression likely occurred due to Dependabot version upgrades of error-stack-parser which still satisfied the version requirements of this package (^2.1.4) but which cause the regression in stack parsing and led to stack traces not being available in Airbrake.

Description

According to this thread:

We have deprecated v2.1.3, v2.1.2, v2.1.1, v2.1.0, and v3.0.0 using npm deprecate [email protected] "Please upgrade to error-stack-parser >= v2.1.4, see stacktracejs/error-stack-parser#80".

This package should not allow any of the affected versions.

🔬 Minimal Reproduction

https://gist.github.com/...

See stacktracejs/error-stack-parser#80 for more info and possible repro steps. Using v2.1.3 of error-stack-parser and trying to log an airbrake error for an exception should result in an error like (obviously stack and error details are specific to my setup & code):

🔥 Exception or Error





ErrorStackParser: TypeError: error_stack_parser_1.default.parse is not a function Error: No such token: 'card_0MEJ2FqWxM0n7YqD8YCITGJJ'
    at Function.generate (/Users/kvarga/Workdir/github.com/change/payment_service/node_modules/stripe/lib/Error.js:38:16)
    at res.toJSON.then.StripeAPIError.message (/Users/kvarga/Workdir/github.com/change/payment_service/node_modules/stripe/lib/StripeResource.js:190:35)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
ErrorStackParser: TypeError: error_stack_parser_1.default.parse is not a function Error: fake
    at Notifier.espProcessor [as _processor] (/Users/kvarga/Workdir/github.com/change/payment_service/node_modules/@airbrake/browser/src/processor/esp.ts:48:15)
    at Notifier.BaseNotifier.notify (/Users/kvarga/Workdir/github.com/change/payment_service/node_modules/@airbrake/browser/src/base_notifier.ts:150:22)
    at Notifier.notify (/Users/kvarga/Workdir/github.com/change/payment_service/node_modules/@airbrake/node/src/notifier.ts:77:24)
    at notify (/Users/kvarga/Workdir/github.com/change/payment_service/lib/airbrake.ts:27:24)
    at trackError (/Users/kvarga/Workdir/github.com/change/payment_service/lib/error_helper.js:24:5)
    at StripeRouter.routeRequest (/Users/kvarga/Workdir/github.com/change/payment_service/lib/gateway_router/stripe/router.js:52:7)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createCharge (/Users/kvarga/Workdir/github.com/change/payment_service/routes/v2/charges/post.js:147:26)
    at async /Users/kvarga/Workdir/github.com/change/payment_service/middleware/json_promise_handler.ts:19:24


🌍 Your Environment

@airbrake/* version:




"@airbrake/node": "2.1.7",

Anything else relevant?

I'm using error-stack-parser 2.1.3

@kjvarga kjvarga added the bug label Dec 12, 2022
@kjvarga kjvarga changed the title error-stack-parser versions < 2.1.4 cause stack parsing to fail with ErrorStackParser.parse is not a function error error-stack-parser versions < 2.1.4 causes stack parsing to fail with ErrorStackParser.parse is not a function error Dec 12, 2022
@jlowcs
Copy link

jlowcs commented Jan 3, 2023

This package actually references ^2.0.4, but thanks for the flag :)

@dparish
Copy link

dparish commented Oct 1, 2023

Take a look at:

https://github.com/dparish/airbrake-js-lite

That's only for browsers but when building that I used the latest version of error-stack-parser.

I'm not sure if it will fix it but it might.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants