Skip to content
Merged
Changes from all commits
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
11 changes: 7 additions & 4 deletions packages/bundler-plugin-core/src/plugins/debug-id-upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function debugIdUploadPlugin({
await prepareBundleForDebugIdUpload(
chunkFilePath,
tmpUploadFolder,
String(chunkIndex),
chunkIndex,
logger,
rewriteSourcesHook ?? defaultRewriteSourcesHook
);
Expand Down Expand Up @@ -130,7 +130,7 @@ export function debugIdUploadPlugin({
export async function prepareBundleForDebugIdUpload(
bundleFilePath: string,
uploadFolder: string,
uniqueUploadName: string,
chunkIndex: number,
logger: Logger,
rewriteSourcesHook: RewriteSourcesHook
) {
Expand All @@ -147,12 +147,14 @@ export async function prepareBundleForDebugIdUpload(

const debugId = determineDebugIdFromBundleSource(bundleContent);
if (debugId === undefined) {
logger.warn(
logger.debug(
`Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: ${bundleFilePath}`
);
return;
}

const uniqueUploadName = `${debugId}-${chunkIndex}`;

bundleContent += `\n//# debugId=${debugId}`;
const writeSourceFilePromise = fs.promises.writeFile(
path.join(uploadFolder, `${uniqueUploadName}.js`),
Expand Down Expand Up @@ -227,7 +229,8 @@ async function determineSourceMapPathFromBundle(
// noop
}

logger.warn(`Could not determine source map path for bundle: ${bundlePath}`);
// This is just a debug message because it can be quite spammy for some frameworks
logger.debug(`Could not determine source map path for bundle: ${bundlePath}`);
return undefined;
}

Expand Down