Typescript/express: source code was not found because the distribution did not match

I am using the @sentry/webpack-plugin for my Typescript/node/express server application, and I am uploading source maps on deploy. I am using the hosted version Sentry. The releases look correct to me, including the list of artifacts and their contents.

When an error is captured, the stack trace correctly identifies the Typescript files and lines. However, it does not display the source because of this error:

Source code was not found because the distribution did not match

Current Distribution none
Expected Distribution None
Url app:///webpack:/api/src/graphql/stage-tasks/resolvers.ts

The only similar problem I can find online is this one from this forum, however their solution does not seem to match my situation since I am not using tracing.

I do not set a dist when creating a release, but I went to give it a try to see if I could solve this problem that way. I found how to set the dist at Sentry.init in the application code, but it seems that I cannot set dist in the SentryWebpackPlugin constructor since the type definition does not include it, even though the documentation in the README states that it exists.

I’m not sure what to try next. Any suggestions? Thanks!

Well, I got this to work correctly by setting dist at Sentry.init and not setting a distribution at release time. I guess all it took was a rubber duck session.

Hopefully my journey will help someone else.

Good to know, had the exact same issue. For me the fix was to set the correct path for tracing Origins

 new Integrations.BrowserTracing({
                tracingOrigins: [
                routingInstrumentation: Sentry.routingInstrumentation,