Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/bundler-plugin-core/src/debug-id-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export function createDebugIdUploadFunction({
sentryBuildPluginManager,
}: DebugIdUploadPluginOptions) {
return async (buildArtifactPaths: string[]) => {
await sentryBuildPluginManager.uploadSourcemaps(buildArtifactPaths);
// Webpack and perhaps other bundlers allow you to append query strings to
// filenames for cache busting purposes. We should strip these before upload.
const cleanedPaths = buildArtifactPaths.map((p) => p.split("?")[0] || p);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: we already have a stripQueryAndHashFromPath helper we can reuse here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah missed that!

await sentryBuildPluginManager.uploadSourcemaps(cleanedPaths);
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/integration-tests/utils/create-cjs-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function createCjsBundles(
output: {
path: path.join(outFolder, "webpack4"),
libraryTarget: "commonjs",
filename: "[name].js?[contenthash]",
},
target: "node", // needed for webpack 4 so we can access node api
plugins: [sentryWebpackPlugin(sentryUnpluginOptions)],
Expand Down
Loading