-
-
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
Wrong stack frame file path for macOS universal app #1010
Comments
Have you tried the latest version of the SDK? You appear to be a full major version behind. |
Reading through this again, it sounds like |
Update Here is a problem: https://github.com/getsentry/sentry-electron/blob/master/src/main/normalize.ts#L17, filename is not normalized. Demo // https://github.com/getsentry/sentry-javascript/blob/master/packages/utils/src/normalize.ts#L285
function normalizeUrlToBase(url: string, basePath: string): string {
const escapedBase = basePath
// Backslash to forward
.replace(/\\/g, '/')
// Escape RegExp special characters
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&');
let newUrl = url;
try {
newUrl = decodeURI(url);
} catch (_Oo) {
// Sometime this breaks
}
return (
newUrl
.replace(/\\/g, '/')
.replace(/webpack:\/?/g, '') // Remove intermediate base path
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
.replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')
);
}
const APP_PATH = 'D:\\sentry_test_app\\app.asar' // app.getAppPath()
// 1. Non-universal app => path normalized
console.log(normalizeUrlToBase('D:\\sentry_test_app\\app.asar\\dist\\main\\index.js', APP_PATH))
// app:///dist/main/index.js
// 2. Universal app => path is not normalized
console.log(normalizeUrlToBase('D:\\sentry_test_app\\app-arm64.asar\\dist\\main\\index.js', APP_PATH))
// D:/sentry_test_app/app-arm64.asar/dist/main/index.js |
The normalisation code relies on |
This has already been fixed in the latest |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Electron SDK Version
4.17.0
Electron Version
30
What platform are you using?
MacOS
Link to Sentry event
No response
Steps to Reproduce
For errors coming from a macOS universal app, I get the full path in a stack trace:
Correct path from non-universal app:
app.getAppPath()
returns the path toapp.asar
, but the files are located inapp-arm64.asar
orapp-x64.asar
, depending on the device architecture.To build a universal app, I use
@electron/universal
withmergeASARs: false
option.Expected Result
...
Actual Result
...
The text was updated successfully, but these errors were encountered: