Uncaught TypeError: Cannot read property 'getAppPath' of undefined
See original GitHub issue- Review the documentation: https://docs.sentry.io/platforms/javascript/electron/
- Search for existing issues: https://github.com/getsentry/sentry-electron/issues
- Use the latest release: https://github.com/getsentry/sentry-electron/releases
- Provide a link to the affected event from your Sentry account
Versions + Platform
- SDK version -
@sentry/electron@v1.5.1
- Electron version -
electron@v7.2.4
- Platform -
Windows
Description
I updated from 0.17.0 to 1.5.1, and I now see this error:
Uncaught TypeError: Cannot read property 'getAppPath' of undefined
at eval (webpack-internal:///./app/node_modules/@sentry/electron/esm/main/normalize.js:8)
at Module../app/node_modules/@sentry/electron/esm/main/normalize.js (renderer.js:1907)
at __webpack_require__ (renderer.js:750)
at fn (renderer.js:61)
at eval (webpack-internal:///./app/node_modules/@sentry/electron/esm/main/backend.js:15)
at Module../app/node_modules/@sentry/electron/esm/main/backend.js (renderer.js:1811)
at __webpack_require__ (renderer.js:750)
at fn (renderer.js:61)
at eval (webpack-internal:///./app/node_modules/@sentry/electron/esm/main/client.js:8)
at Module../app/node_modules/@sentry/electron/esm/main/client.js (renderer.js:1823)
I found a couple of issues (https://github.com/getsentry/sentry-electron/issues/92, https://github.com/getsentry/sentry-electron/issues/142) that reference this error, though they seem to be focused on different errors. I tried the deep import mentioned here, to no avail.
This was working with no issues previously, and the only change I made was to update to 1.5.1. I didn’t see any breaking changes that suggest a problem in this area.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top Results From Across the Web
TypeError: Cannot read property 'getAppPath' of undefined
The issue is that electron is giving a error when it is trying to access the appPath() method. This same code works elsewhere...
Read more >TypeError: Cannot read property 'getAppPath' of undefined ...
I want to test my Electron app with spectron, when I require a model "Record" defined by my self, I get an error:...
Read more >electron.App.getAppPath JavaScript and Node.js ... - Tabnine
Best JavaScript code snippets using electron.App.getAppPath(Showing top 12 results out of 315) · main.js/ipcMain.on · app/modules/views.js/undefined/load · main.js ...
Read more >[Electron Quick Start Issue] TypeError: Cannot read property ...
I was following Writing Your First Electron App https://electronjs.org/docs/tutorial/first-app I got the error as titled. I searched and a solution is found ...
Read more >cannot read properties of undefined (reading 'ipcrenderer')
I'm trying to set up some cookies for my electron application but when the code on the function below executes, this error comes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, this will be the cause. You’re telling webpack that your renderer is a node process and this means it’ll look at the
main
field inpackage.json
which points at the code for the Electron main process.In the renderer you’re going to have to import the esm build manually. I’ve not actually tried this myself, but It’ll be something like this:
Link fixed.
I’ve opened a new issue for errors missing from the preload context: #372