Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Attempt to invoke user-land function #6900

Locked Unanswered
strangecarr asked this question in Q&A
Discussion options

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...)

You must be logged in to vote

Replies: 1 comment

Comment options

Tracked in #6632

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /