Skip to content

Conversation

seoyeon9888
Copy link

@seoyeon9888 seoyeon9888 commented Oct 1, 2025

fix #17837

add basePath prefix to createRouteManifest

closes #17837

}

const { dynamicRoutes, staticRoutes } = scanAppDirectory(targetDir, '', options?.includeRouteGroups);
const { dynamicRoutes, staticRoutes } = scanAppDirectory(targetDir, options?.basePath, options?.includeRouteGroups);
Copy link

Choose a reason for hiding this comment

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

Bug: Route Manifest Cache and Base Path Handling

The createRouteManifest cache doesn't invalidate when the basePath option changes, leading to stale manifests with incorrect route prefixes. Also, passing options?.basePath directly to scanAppDirectory can prefix routes with 'undefined/' when basePath is not provided.

Fix in Cursor Fix in Web

@chargome
Copy link
Member

chargome commented Oct 1, 2025

Looks good already, would you mind also reflecting this in one of the e2e-tests (dev-packages/e2e-tests/test-applications)?

@chargome chargome self-assigned this Oct 1, 2025
@seoyeon9888
Copy link
Author

seoyeon9888 commented Oct 1, 2025

Looks good already, would you mind also reflecting this in one of the e2e-tests (dev-packages/e2e-tests/test-applications)?

@chargome

If I apply a basePath to the existing E2E test application, it seems that all transaction assertions and URL paths in the test code would need to include the basePath prefix.
Is this the recommended approach?

Could you provide some guidance on whether it would be better to add tests directly to the existing app, or to create a separate app with basePath enabled for testing purposes?

@chargome
Copy link
Member

chargome commented Oct 2, 2025

We can move this into a new next-15-basepath test. Feel free to ping me if I should take this over!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nextjs app dir basePath route manifest bug
2 participants