Skip to content

Conversation

@conico974
Copy link
Contributor

Update Next.js to version 16.1.1 and implement a patch to dynamically locate the next.config file, ensuring compatibility with the skipTrailingSlashRedirect requirement.

@changeset-bot
Copy link

changeset-bot bot commented Dec 31, 2025

🦋 Changeset detected

Latest commit: 5bdc712

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 31, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/aws@1072

commit: 5bdc712

@github-actions
Copy link
Contributor

github-actions bot commented Dec 31, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 28.05% 2884 / 10278
🔵 Statements 28.05% 2884 / 10278
🔵 Functions 52.44% 150 / 286
🔵 Branches 76.28% 727 / 953
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/open-next/src/build/copyTracedFiles.ts 8.04% 100% 25% 8.04% 60-64, 76-401
packages/open-next/src/build/createServerBundle.ts 0% 0% 0% 0% 1-398
packages/open-next/src/build/patch/codePatcher.ts 49.49% 95.45% 66.66% 49.49% 69-70, 126-182
packages/open-next/src/build/patch/patches/index.ts 0% 0% 0% 0% 1
packages/open-next/src/build/patch/patches/patchNextConfig.ts 0% 0% 0% 0% 1-63
Generated in workflow #1670 for commit 5bdc712 by the Vitest Coverage Report Action

versions: ">=16.1.0",
patchCode: async ({ code, buildOptions }) => {
// Find the next.config file with any supported extension
const possibleExtensions = [".ts", ".mjs", ".js", ".cjs"];
Copy link
Contributor

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?

Copy link
Contributor

@vicb vicb Dec 31, 2025

Choose a reason for hiding this comment

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

configToImport = configPath;
}

// In next 16.1+ we need to add `skipTrailingSlashRedirect` manually because next removes it from the config
Copy link
Contributor

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?

Copy link
Contributor Author

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

@conico974 conico974 merged commit 35af007 into main Jan 1, 2026
3 checks passed
@conico974 conico974 deleted the conico/fix-161 branch January 1, 2026 10:30
vicb added a commit to opennextjs/opennextjs-cloudflare that referenced this pull request Jan 16, 2026
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.

3 participants