-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/gatsby
SDK Version
10.46.0
Framework Version
Gatsby 5.16.1
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Install:
- @sentry/gatsby: 10.46.0
- gatsby: 5.16.1
Run a Gatsby build which will trigger a Sentry error and observe that the build will fail with this error:
error UNHANDLED REJECTION invokeErr is not a function
TypeError: invokeErr is not a function
at Object.errorHandler ([repo]/node_modules/@sentry/gatsby/gatsby-node.js:58:13)
at handleRecoverableError ([repo]/node_modules/@sentry/bundler-plugin-core/dist/cjs/index.js:5728:48)
at async Object.uploadSourcemaps ...
This is because the error handler code (in @sentry/gatsby/gatsby-node.js:58:13) is passing two arguments:
errorHandler(err, invokeErr) {
...
invokeErr(err);
}
However, the recently updated @sentry/bundler-plugin-core calls options.errorHandler with only a single Error argument:
options.errorHandler(unknownError)
This mismatch causes builds to fail because invokeErr is undefined.
Expected Result
The real/underlying Sentry error should be surfaced rather than the build failing due to this issue. It should not fail with "invokeErr is not a function".
Actual Result
The error is not handled and the build process fails.
Additional Context
Suggested fix: update the errorHandler in @sentry/gatsby to match the updated webpack plugin API.
Priority
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.
Metadata
Metadata
Assignees
Fields
Give feedbackProjects
Status