Sentry-javascript: Function.prototype.toString: 'this' is not a Function object

Created on 15 Nov 2017  路  11Comments  路  Source: getsentry/sentry-javascript

Having an issue configuring raven.js since updating to 3.20.0 with IE11.

It's an Angular (5.0.1) CLI (1.5.0) app with a typical setup in app.module:

  .config('https://[email protected]/...', {
    environment: environment,
    release: version
  })
  .install();

Running the app causes an error in IE11 Function.prototype.toString: 'this' is not a Function object. Chrome and Firefox are ok.

Reverting to 3.19.1 resolves the issue.

Needs Reproduction

All 11 comments

i got same issue in my projects.

  • angular 5.0.1 , cli 1.5.0, rave-js 3.20.0

Seems to be related to this:

https://github.com/getsentry/raven-js/commit/30c0da44f1b1f1a82b2183decd7b60c2d277449a#diff-768fd3ae72b2025ae6a7de0b04b78608R1013

Can you please provide a whole stack trace and/or a minimal repro-case?
We test our releases on >= IE10, including installation itself and it works just fine when using without any frameworks. I need more information to debug this.

I can try later tonight. I saw it on our site this morning, but everything has been minified to heck and back, but i will try to capture the stack trace in a non-prod build.

Same here. Issue occurs in Edge as well.

Full stack trace:

[Main Thread]
toString [Line: 2354, Col: 3], polyfills.bundle.js
Function.prototype.toString [Line: 7328, Col: 9], polyfills.bundle.js
Function.prototype.toString [Line: 4823, Col: 9], vendor.bundle.js
checkIEAndCrossContext [Line: 8615, Col: 17], polyfills.bundle.js
Anonymous function [Line: 7623, Col: 17], polyfills.bundle.js
Anonymous function [Line: 4920, Col: 15], vendor.bundle.js
Raven.prototype._instrumentBreadcrumbs [Line: 5161, Col: 9], vendor.bundle.js
Raven.prototype.install [Line: 4102, Col: 48], vendor.bundle.js
../../../../../src/app/app.module.ts [Line: 97, Col: 1], main.bundle.js
__webpack_require__ [Line: 54, Col: 1], bootstrap a0d6fd4ad5fe0c8de7d1
../../../../../src/main.ts [Line: 161, Col: 22], main.bundle.js
__webpack_require__ [Line: 54, Col: 1], bootstrap a0d6fd4ad5fe0c8de7d1
Anonymous function [Line: 204, Col: 1], main.bundle.js
__webpack_require__ [Line: 54, Col: 1], bootstrap a0d6fd4ad5fe0c8de7d1
webpackJsonpCallback [Line: 25, Col: 1], bootstrap a0d6fd4ad5fe0c8de7d1
Global code [Line: 1, Col: 1], main.bundle.js

Reproducable code repo coming up

https://github.com/asgerjensen/raven-js-ie-issue

If you switch from 3.20.0 to 3.19.1 it starts working. Be sure to clear node_modules and package-lock.json

Also, i removed my key from app.module.ts, you probably have one or two lying around....

I think, maybe the issue is a conflict with some of the other polyfills that IE require from core-js.

Thanks @asgerjensen. Will investigate as soon as possible.

Fixed in 3.20.1

We have the same problem in Chrome 62.0.3202.94 in 3.20.1 :(

@kamilogorek strange, but this error occurs only if we use raven-js/dist/raven.min.js bundle.

Was this page helpful?
0 / 5 - 0 ratings