Skip to content

@sentry.vue throw error [Cannot read property 'Symbol(Symbol.iterator)' of undefined] #8870

Closed
@Tecode

Description

@Tecode

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/vue

SDK Version

7.64.0

Framework Version

Vue 2.7.14

Link to Sentry event

No response

SDK Setup

If you use new Sentry.BrowserTracing, putting an array will throw an exception

Sentry.init({
      Vue,
      dsn: 'You DNS',
      integrations: [
        new Sentry.BrowserTracing({
          // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
          // tracePropagationTargets: [],
          routingInstrumentation: Sentry.vueRouterInstrumentation(router)
        })
],
// Performance Monitoring
tracesSampleRate: 0.1, // Capture 100% of the transactions, reduce in production!
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 0.1 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
    })

No error is reported using the following method

Sentry.init({
      Vue,
      dsn: 'You DNS',
      integrations: [],
      // Performance Monitoring
      tracesSampleRate: 0.1, // Capture 100% of the transactions, reduce in production!
      // Session Replay
      replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
      replaysOnErrorSampleRate: 0.1 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
})

Steps to Reproduce

1.Initialize Sentry ,in integrations array is passed in new Sentry.BrowserTracing.

2.An error is reported during initialization, with Cannot read property 'Symbol(Symbol.iterator)' of undefined.If integrations is passed in an empty array, no error will be reported.
image

Expected Result

integrations passed in new Sentry.BrowserTracing does not report an error.

Actual Result

The version of the browser that reported an error
Operating system:Windows7/Windows >=10
UC Browser/6.2.4098
Chrome/55.0.2883
Chrome/55.0.2987

image

node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js

import unsupportedIterableToArray from "./unsupportedIterableToArray.js";
export default function _createForOfIteratorHelper(o, allowArrayLike) {
  var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
  if (!it) {
    if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
      if (it) o = it;
      var i = 0;
      var F = function F() {};
      return {
        s: F,
        n: function n() {
          if (i >= o.length) return {
            done: true
          };
          return {
            done: false,
            value: o[i++]
          };
        },
        e: function e(_e) {
          throw _e;
        },
        f: F
      };
    }
    throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  var normalCompletion = true,
    didErr = false,
    err;
  return {
    s: function s() {
      it = it.call(o);
    },
    n: function n() {
      var step = it.next();
      normalCompletion = step.done;
      return step;
    },
    e: function e(_e2) {
      didErr = true;
      err = _e2;
    },
    f: function f() {
      try {
        if (!normalCompletion && it["return"] != null) it["return"]();
      } finally {
        if (didErr) throw err;
      }
    }
  };
}

Metadata

Metadata

Assignees

Labels

Package: vueIssues related to the Sentry Vue SDK

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions