-
Notifications
You must be signed in to change notification settings - Fork 184
Fix Next 16.1 not including skipTrailingSlashRedirect #1072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 5bdc712 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This reverts commit e02abbe.
| versions: ">=16.1.0", | ||
| patchCode: async ({ code, buildOptions }) => { | ||
| // Find the next.config file with any supported extension | ||
| const possibleExtensions = [".ts", ".mjs", ".js", ".cjs"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like .mts is also supported from the Next repo.
line 34 should be updated below as well.
Maybe use {extension: isTypeScript} instead of an array here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://nextjs.org/docs/pages/api-reference/config/typescript#for-commonjs-projects-default also mentions .cts in a note, not sure if really needed?
| configToImport = configPath; | ||
| } | ||
|
|
||
| // In next 16.1+ we need to add `skipTrailingSlashRedirect` manually because next removes it from the config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: do you think this should be reported as an issue on the Next repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could, but I think they did it on purpose. Looks like they use define for that now, and I checked, it is defined in the adapter output
Update Next.js to version 16.1.1 and implement a patch to dynamically locate the
next.configfile, ensuring compatibility with theskipTrailingSlashRedirectrequirement.