sentry-electron icon indicating copy to clipboard operation
sentry-electron copied to clipboard

Cannot read properties of undefined (reading 'prototype')

Open MLDMoritz opened this issue 3 years ago • 1 comments

Versions + Platform

"@sentry/electron": "^4.0.0", "electron": "^17.0.0", Windows

Description

Trying to setup the main process:

[Window Title] Error

[Main Instruction] A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
TypeError: Cannot read properties of undefined (reading 'prototype')
    at eval (webpack:///./node_modules/core-js/modules/web.dom-exception.stack.js?:42:74)
    at Object../node_modules/core-js/modules/web.dom-exception.stack.js (C:\kiosk-prot\dist_electron\index.js:5801:1)
    at __webpack_require__ (C:\kiosk-prot\dist_electron\index.js:20:30)
    at eval (webpack:///./node_modules/@sentry/utils/esm/supports.js?:11:100)
    at Module../node_modules/@sentry/utils/esm/supports.js (C:\kiosk-prot\dist_electron\index.js:1800:1)
    at __webpack_require__ (C:\kiosk-prot\dist_electron\index.js:20:30)
    at eval (webpack:///./node_modules/@sentry/utils/esm/instrument.js?:8:70)
    at Module../node_modules/@sentry/utils/esm/instrument.js (C:\kiosk-prot\dist_electron\index.js:1620:1)
    at __webpack_require__ (C:\kiosk-prot\dist_electron\index.js:20:30)
    at eval (webpack:///./node_modules/@sentry/utils/esm/index.js?:22:72)

[OK]

This is my background.js ( main proc) :

import * as Sentry from "@sentry/electron/main";

Sentry.init({ dsn: "https://[email protected]/6676988" });

MLDMoritz avatar Aug 22 '22 11:08 MLDMoritz

That looks like an interesting stack trace and I'd like to get the bottom of what's happening but I'll need a way to reproduce it locally. Do you have a minimal reproduction for this including the webpack config?

The stack trace suggests that it's caused by a call to instrument and then supportsNativeFetch in @sentry/utils but it's not clear how or why this code is being run from the main process. The stack trace looks truncated.

timfish avatar Aug 22 '22 15:08 timfish

Since I've not heard back I'll close this issue for now but please do re-open this if you have any more information to help me track it down.

timfish avatar Oct 05 '22 15:10 timfish