NS_ERROR_FAILURE No error message
- [x] Review the documentation: https://docs.sentry.io/
- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- [ ] Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- [ ] Provide a link to the affected event from your Sentry account
Package + Version
- [x]
@sentry/browser5.17.0
Description
Faced this issue in our Sentry. Unfortunately, have no repro steps, but happens only in Firefox.
NS_ERROR_FAILURE: No error message
at historyReplacementFunction/<(./node_modules/@sentry/utils/esm/instrument.js:286:1)
at push/<(./node_modules/history/esm/history.js:357:1)
at confirmTransitionTo(./node_modules/history/esm/history.js:145:1)
at push(./node_modules/history/esm/history.js:350:1)
at navigate(./node_modules/react-router-dom/esm/react-router-dom.js:191:1)
at onClick(./node_modules/react-router-dom/esm/react-router-dom.js:149:1)
at callCallback(./node_modules/react-dom/cjs/react-dom.development.js:336:1)
at sentryWrapped(./node_modules/@sentry/browser/esm/helpers.js:71:1)
at invokeGuardedCallbackDev(./node_modules/react-dom/cjs/react-dom.development.js:385:1)
at invokeGuardedCallback(./node_modules/react-dom/cjs/react-dom.development.js:440:1)
at invokeGuardedCallbackAndCatchFirstError(./node_modules/react-dom/cjs/react-dom.development.js:454:1)
at executeDispatch(./node_modules/react-dom/cjs/react-dom.development.js:584:1)
at executeDispatchesInOrder(./node_modules/react-dom/cjs/react-dom.development.js:609:1)
at executeDispatchesAndRelease(./node_modules/react-dom/cjs/react-dom.development.js:713:1)
at executeDispatchesAndReleaseTopLevel(./node_modules/react-dom/cjs/react-dom.development.js:722:1)
at forEachAccumulated(./node_modules/react-dom/cjs/react-dom.development.js:694:1)
at runEventsInBatch(./node_modules/react-dom/cjs/react-dom.development.js:739:1)
at runExtractedPluginEventsInBatch(./node_modules/react-dom/cjs/react-dom.development.js:880:1)
at handleTopLevel(./node_modules/react-dom/cjs/react-dom.development.js:5803:1)
at batchedEventUpdates$1(./node_modules/react-dom/cjs/react-dom.development.js:24401:1)
at batchedEventUpdates(./node_modules/react-dom/cjs/react-dom.development.js:1415:1)
at dispatchEventForPluginEventSystem(./node_modules/react-dom/cjs/react-dom.development.js:5894:1)
at attemptToDispatchEvent(./node_modules/react-dom/cjs/react-dom.development.js:6010:1)
at dispatchEvent(./node_modules/react-dom/cjs/react-dom.development.js:5914:1)
at unstable_runWithPriority(./node_modules/scheduler/cjs/scheduler.development.js:697:1)
at runWithPriority$2(./node_modules/react-dom/cjs/react-dom.development.js:12149:1)
at discreteUpdates$1(./node_modules/react-dom/cjs/react-dom.development.js:24417:1)
at discreteUpdates(./node_modules/react-dom/cjs/react-dom.development.js:1438:1)
at dispatchDiscreteEvent(./node_modules/react-dom/cjs/react-dom.development.js:5881:1)

What I noticed from breadcrumbs: this issue is happening when user is using navigation from one url to another. But cannot reproduce this by my own.
I looked into function
https://github.com/getsentry/sentry-javascript/blob/f48efb82c944b423c0bd7ad879992192a2788b5b/packages/utils/src/instrument.ts#L345
and nothing has changed there from 5.17.0 version.
Any ideas on this?
NS_ERROR_FAILURE is a generic Firefox error which is not too helpful here, unfortunately. The error points to the SDK, because we are calling the function that was wrapped to capture breadcrumb, and this function is what's throwing.
Based on the stacktrace and history@v4 code:
globalHistory.pushState({
key: key,
state: state
}, null, href);
I'd guess that there's some firefox coercion issue, where it's trying to store an invalid state (just a guess).
You can try to disable history breadcrumbs and wait some time to see whether it resurfaces and bubbles up to the global handler with some other error:
Sentry.init({
integrations: [new Sentry.Integrations.Breadcrumbs({ history: false })]
})
Cheers!
Closing the issue as a part of large repository cleanup, due to it being inactive and/or outdated. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!
👋 Hey @kamilogorek - I got to this fairly remote issue due to having run into the same thing:
"@sentry/browser@^6.0.2":
version "6.4.0"
error info in Sentry:
NS_ERROR_NOT_INITIALIZED
wytX/c</e.prototype._wrapTimeFunction/<(assets/vendor/...
I would provide you a link directly to the source, but this specific one originates from:
// @sentry/browser/build/bundle.js#5780
TryCatch.prototype._wrapTimeFunction = function (original) {
Which seems to be defined here: https://github.com/getsentry/sentry-javascript/blob/01982bf2518e667ff5e3a17c80ab6a55b34db345/packages/browser/src/integrations/trycatch.ts#L86
Event link: https://sentry.io/organizations/aha-labs-inc/issues/2567370894/events/f2b9eae58a6f4f39a85fc82b7c93f8c9/
edit: have some feedback indicating some issue potentially related to this is occurring on recent versions of chrome and edge, but I don't understand enough at the moment to be able to say that's what's going on.