Skip to content

Commit dbbf241

Browse files
committed
fix: next sentry create route manifest basepath bug
1 parent 64ef553 commit dbbf241

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/nextjs/src/config/manifest/createRouteManifest.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export type CreateRouteManifestOptions = {
1010
* By default, route groups are stripped from paths following Next.js convention.
1111
*/
1212
includeRouteGroups?: boolean;
13+
/**
14+
* Base path for the application, if any. This will be prefixed to all routes.
15+
*/
16+
basePath?: string;
1317
};
1418

1519
let manifestCache: RouteManifest | null = null;
@@ -192,7 +196,7 @@ export function createRouteManifest(options?: CreateRouteManifestOptions): Route
192196
return manifestCache;
193197
}
194198

195-
const { dynamicRoutes, staticRoutes } = scanAppDirectory(targetDir, '', options?.includeRouteGroups);
199+
const { dynamicRoutes, staticRoutes } = scanAppDirectory(targetDir, options?.basePath, options?.includeRouteGroups);
196200

197201
const manifest: RouteManifest = {
198202
dynamicRoutes,

packages/nextjs/src/config/withSentryConfig.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ function getFinalConfigObject(
147147

148148
let routeManifest: RouteManifest | undefined;
149149
if (!userSentryOptions.disableManifestInjection) {
150-
routeManifest = createRouteManifest();
150+
routeManifest = createRouteManifest({
151+
basePath: incomingUserNextConfigObject.basePath,
152+
});
151153
}
152154

153155
setUpBuildTimeVariables(incomingUserNextConfigObject, userSentryOptions, releaseName);

0 commit comments

Comments
 (0)