-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
2.6.4
Description
This is my raven configuration in index.ts
import * as Raven from 'raven'
Raven.config('<dsn link>', {
release: require('./package.json').version,
captureUnhandledRejections: true,
sendTimeout: process.env.NODE_ENV === 'production' ? 2 : 5,
dataCallback: function (data) {
const stacktrace = data.exception && data.exception[0].stacktrace
console.log(stacktrace.frames)
if (stacktrace && stacktrace.frames) {
stacktrace.frames.forEach(function(frame) {
if (frame.filename.startsWith('/')) {
frame.filename = 'app:///' + path.basename(frame.filename)
}
})
}
return data
}
}).install()
and here's my webpack config for server:
{
entry: {
server: path.resolve(__dirname, 'index.ts')
},
externals: [nodeExternals()],
devtool: 'source-map',
target: 'node',
output: {
path: path.resolve(__dirname),
filename: './server/server.js',
libraryTarget: 'commonjs',
publicPath: path.resolve(__dirname)
},
node: {
__dirname: true
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
plugins: [
new SentryPlugin({
release: require('./package.json').version,
include: './server', // uploads only server.js and server.map.js files
ignore: ['node_modules', 'webpack.config.js'],
debug: true,
})
]
}
It works fine, but if I throw even a very simple error, here's the filenames in stacktrace inside the dataCallback
function handler:
0:"internal/process/next_tick.js"
1:"internal/process/promises.js"
2:"events.js"
3:"events.js"
4:"/Users/dev/../../../../folder path../node_modules/raven/lib/client.js"
5:"/Users/dev/../../../../folder path../node_modules/raven/lib/client.js"
Which is obviously wrong as error was thrown in server.js
file served through node server/server.js
command. This then is uploaded to sentry which obviously throws this warning:
Source code was not found for app:///client.js
What am I doing wrong here?
Metadata
Metadata
Assignees
Labels
No labels