-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Object(...) is not a function #363
Comments
Nothing changed drastically between 2.4.0 and 2.5.2 and there haven't been any other reports of similar issues. I'd be happy to look at a repository that demonstrates the issue, but without a reproducible example, I have no way to diagnose what's causing this. |
We are getting the same error with |
If someone can supply a simple reproduction of this issue I more easily advise of the cause. |
We don't see the issue with a fresh Electron Forge + Webpack + Typescript project, even after downgrading to use the same versions of We're using Typescript and the issue persists with both I've tried both I'm a bit stuck as how to reproduce this in a minimal project! |
What code does the error originate from? ie. what code does the top of the stack trace point to? |
Just as the stack trace above, the error occurs within the I tried adding logging into the |
What does your webpack configuration look like? TypeScript config? It seems like webpack somehow messes up the imports when bundling but nothing drastic has changed between 2.4.0 and 2.5.2. The only time I've seen webpack bundle with no errors but it fail at something like this at runtime has been related to TypeScript |
Exact same issue here. Rolling back to 2.4.1 fixes the problem. The error points to this line function init(options) {
var electronIntegrations = _sentry_node__WEBPACK_IMPORTED_MODULE_4__["defaultIntegrations"].filter(function (integration) { return integration.name !== 'OnUncaughtException'; });
if (options.defaultIntegrations === undefined) {
--> options.defaultIntegrations = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spreadArray"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spreadArray"])([], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(electronIntegrations)), [
// eslint-disable-next-line @typescript-eslint/unbound-method
new _integrations__WEBPACK_IMPORTED_MODULE_6__["OnUncaughtException"]({ onFatalError: options.onFatalError }),
new _integrations__WEBPACK_IMPORTED_MODULE_6__["Electron"](),
]);
}
Object(_sentry_core__WEBPACK_IMPORTED_MODULE_2__["initAndBind"])(_client__WEBPACK_IMPORTED_MODULE_5__["MainClient"], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ transport: _transports_net__WEBPACK_IMPORTED_MODULE_7__["NetTransport"] }, options));
} |
@ThomasSzabo thanks for the update. My best guess is that this has been caused by the upgrade of the What versions of the TypeScript compiler are you using in your projects where this issue can be reproduced? I'm guessing <3.9? @AbhiPrasad is |
We're having this problem with a project using Typescript 4.0.5. I finally managed to repro the error in a minimal project by copying all dependencies from our project's Thanks for looking into this, @timfish! |
@chetbox I updated your Looks like webpack 5 had compatibility issues with |
Thanks @timfish, that works! |
It it possible to change the dependency on |
I'm not sure I follow. You were using a version of For |
Given that |
This comment has been minimized.
This comment has been minimized.
That's not how JavaScript dependency resolution works. It's perfectly valid to have multiple versions of the same dependency in your dependency tree. I'm pretty sure the issue you have encountered is that you listed
Please report different/unrelated issues in new Github issues rather than adding them to this discussion. |
Will do, thanks. I thought it might be related given we didn't get that issue before so wanted to flag it here. I'll see if I can make a minimal repro of this and open a new issue. |
It's due to us being on a lower typescript version, see: getsentry/sentry-javascript#3354 |
If anyone can reproduce this with the correct version of |
Versions + Platform
@sentry/electron@v2.5.2
electron@v9.4.1
Windows
Description
Getting the above error after upgrading from 2.4.0 to 2.5.2.
Downgrading back to 2.4.0 works for now.
Not running the latest Electron, that might be it?
The text was updated successfully, but these errors were encountered: