Skip to content

Critical: @sentry/browser v4.3.3 has usage of undeclared variable #1757

@maxaon

Description

@maxaon

Package + Version

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

Version:

4.3.3

Description

In version 4.3.3 main file (dist/index.js) contains function safeJoin and assign which contains for loops with usage of tslib_1__default.

This variable is not declared anywhere. When we try in our code use console methods we get exception.

Code example:

console.log('sdf')

exception:

Uncaught ReferenceError: tslib_1__default is not defined
    at e.safeJoin (modal?debug:13)
    at console.log (modal?debug:13)
    at <anonymous>:1:9

Source code of safeJoin

function safeJoin(input, delimiter) {
    var e_1, _a;
    if (!Array.isArray(input)) {
        return '';
    }
    var output = [];
    try {
        for (var input_1 = tslib_1__default.__values(input), input_1_1 = input_1.next(); !input_1_1.done; input_1_1 = input_1.next()) {
            var value = input_1_1.value;
            try {
                output.push(String(value));
            }
            catch (e) {
                output.push('[value cannot be serialized]');
            }
        }
    }
    catch (e_1_1) { e_1 = { error: e_1_1 }; }
    finally {
        try {
            if (input_1_1 && !input_1_1.done && (_a = input_1.return)) _a.call(input_1);
        }
        finally { if (e_1) throw e_1.error; }
    }
    return output.join(delimiter);
}

File contain only 2 requirements

var tslib_1 = require('tslib');
var core = require('@sentry/core');

Please see the file https://unpkg.com/@sentry/[email protected]/dist/index.js There is no declaration of tslib_1__default and this is not a global variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions