-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: Error.prepareStackTrace method support #1180
Conversation
Changed the format of the stack trace to match node.js and V8
7ecb60b
to
27aab7b
Compare
27aab7b
to
1538eef
Compare
* prepareStackTrace cache * added stack trace frame format test * use StackFrame::formatStackFrame
a226305
to
bfd5a9f
Compare
@vtrifonov @mbektchiev First thank for that PR! Now there are a few steps to make it work:
devtoolModuleFilenameTemplate: info => {
return info.absoluteResourcePath.split('?')[0];
},
devtoolFallbackModuleFilenameTemplate: info => {
return info.absoluteResourcePath.split('?')[0];
}
const currentApp = knownFolders.currentApp();
process.cwd = function() {
return '';
}
require('source-map-support').install({
environment: 'node',
handleUncaughtExceptions: false,
retrieveSourceMap(source) {
const sourceMapPath = source + '.map';
const appPath = currentApp.path;
let sourceMapRelativePath = sourceMapPath
// .replace('file:///', '')
.replace('file://', '')
.replace(appPath + '/', '')
.replace(appPath + '/', '');
if (sourceMapRelativePath.startsWith('app/')) {
sourceMapRelativePath = sourceMapRelativePath.slice(4);
}
return {
url: sourceMapRelativePath,
map: currentApp.getFile(sourceMapRelativePath).readTextSync()
};
}
}); Multiple things there:
That should be good enough. For now i got this to work perfectly on Android. Now some issues:
Maybe we can discuss all that on slack. Would love to make it work consistently on iOS and Android. I could them publish a Would it be possible for wepback templates to be updated to support this? |
Related to #1135
Added support for Error.prepareStackTrace method similar to the one in V8 and changed the format of the stack trace to be the same as android (also as node and browsers) with
at ...
PR Checklist