-
-
Couldn't load subscription status.
- Fork 1.7k
Attempt to invoke user-land function #6900
-
I have a relatively small app, but have just starting getting error in my local dev when using Sentry:
helpers.js?0b5b:112 on my home page I get - Uncaught TypeError: Cannot read properties of null (reading 'useContext'), on another page I get: TypeError: Cannot read properties of null (reading 'useEffect')
Seems that Sentry isn't liking hooks in my local dev.
This points to the following:
var sentryWrapped = function () {
var args = Array.prototype.slice.call(arguments);
// tslint:disable:no-unsafe-any
try {
// tslint:disable-next-line:strict-type-predicates
if (before && typeof before === 'function') {
before.apply(this, arguments);
}
var wrappedArguments = args.map(function (arg) { return wrap(arg, options); });
if (fn.handleEvent) {
// Attempt to invoke user-land function
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
// means the sentry.javascript SDK caught an error invoking your application code. This
// is expected behavior and NOT indicative of a bug with sentry.javascript.
return fn.handleEvent.apply(this, wrappedArguments);
}
// Attempt to invoke user-land function
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it
// means the sentry.javascript SDK caught an error invoking your application code. This
// is expected behavior and NOT indicative of a bug with sentry.javascript.
return fn.apply(this, wrappedArguments);
// tslint:enable:no-unsafe-any
}
catch (ex) {
ignoreNextOnError();
withScope(function (scope) {
scope.addEventProcessor(function (event) {
var processedEvent = __assign({}, event);
if (options.mechanism) {
addExceptionTypeValue(processedEvent, undefined, undefined);
addExceptionMechanism(processedEvent, options.mechanism);
}
processedEvent.extra = __assign({}, processedEvent.extra, { arguments: args });
return processedEvent;
});
captureException(ex);
});
// THIS IS THE LINE THROWING THE ERROR.
throw ex;
}
};
It seems to only affect local dev, which means I need to switch between regular next.config and next.config with sentry - which isn't great for DX. Has anyone else seen this error and know where it comes from? I am using nextjs13, but not the app folder. Sentry was working fine for a while, so not sure what is throwing this now. I changed something in my Tailwind config (activated JIT, but not sure why that would affect anything in Sentry...)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Tracked in #6632
Beta Was this translation helpful? Give feedback.