Skip to content

vue.js - TypeError: Cannot read property 'toString' of undefined  #3178

Closed
@Tovli

Description

@Tovli

EDIT:
This was due to reject() for the onreject action where I wanted to swallow the exception. It was fixed by changing this to () => {}.

I still consider this as an abnormal behavior of sentry lib as it should not fail on null value on exception (IMO)

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

@sentry/browser 5.30.0 (saw it also on 5.28.0)
vue 2.6.12

0.0.0

Description

On initial load the app breaks and I see the following error in the console:

instrument.js:109 [Vue warn]: Error in config.errorHandler: "TypeError: Cannot read property 'toString' of undefined"

Digging a bit, I get to the following line

_this._options.Vue.util.warn("Error in " + info + ": "" + error.toString() + """, vm);

This belong to this function:

/** Inject Sentry's handler into owns Vue's error handler */
Vue.prototype._attachErrorHandler = function (getCurrentHub) {

and also to this line:

warn(("Error in " + info + ": "" + (err.toString()) + """), vm);

under the function

function logError (err, vm, info) {

and also in this part:

  // this fails for some browsers. :(
                if (originalConsoleLevel) {
                    Function.prototype.apply.call(originalConsoleLevel, global.console, args);
                }

under this function

function instrumentConsole() {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions