Skip to content

Commit e47084a

Browse files
lforstchargome
authored andcommitted
comments and stuff
1 parent f0496d9 commit e47084a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/nextjs/src/client/clientNormalizationIntegration.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ export const nextjsClientStackFrameNormalizationIntegration = defineIntegration(
1414
}
1515

1616
if (assetPrefix) {
17+
// If the user defined an asset prefix, we need to strip it so that we can match it with uploaded sourcemaps.
18+
// assetPrefix always takes priority over basePath.
1719
if (frame.filename?.startsWith(assetPrefix)) {
1820
frame.filename = frame.filename.replace(assetPrefix, 'app://');
1921
}
2022
} else if (basePath) {
23+
// If the user defined a base path, we need to strip it to match with uploaded sourcemaps.
24+
// We should only do this for same-origin filenames though, so that third party assets are not rewritten.
2125
try {
2226
const { origin: frameOrigin } = new URL(frame.filename as string);
2327
if (frameOrigin === windowOrigin) {

0 commit comments

Comments
 (0)