Skip to content

Commit 2319217

Browse files
committed
Fix manual error reporting
All explicit calls to reportError was broken by bundling, which gave us two instances of error-tracking & @sentry/node, meaning that the second was never activated. With this change, there's only one instance.
1 parent 55f586c commit 2319217

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,16 @@ module.exports = {
4141
externals: [
4242
'@oclif/plugin-update/lib/commands/update', // Lots of complicated dynamic requires in @oclif
4343
'registry-js', // Native module
44-
'win-version-info' // Native module
44+
'win-version-info', // Native module
45+
function (context, request, callback) {
46+
if (context !== __dirname && request.endsWith('/error-tracking')) {
47+
// Direct all requires of error-tracking to its entrypoint at the top level,
48+
// except the root require that actually builds the entrypoint.
49+
callback(null, 'commonjs ./error-tracking');
50+
} else {
51+
callback();
52+
}
53+
}
4554
],
4655
plugins: [
4756
// Optimistic require for 'iconv' in 'encoding', falls back to 'iconv-lite'

0 commit comments

Comments
 (0)