Skip to content

fix(cli): honor --dangerously-use-unsupported-next-version when passed as standalone flag - #1319

Merged
vicb merged 3 commits into
opennextjs:mainfrom
muhammadrizkirijalags:fix-command-parsing
Oct 21, 2026
Merged

vicb merged 3 commits into
opennextjs:mainfrom
muhammadrizkirijalags:fix-command-parsing

Conversation

@muhammadrizkirijalags

Copy link
Copy Markdown
Contributor

Closes #1318

This pull request makes a small change to how the presence of the --dangerously-use-unsupported-next-version argument is detected in packages/open-next/src/index.ts. Instead of checking if the argument is not undefined, it now explicitly checks if the argument key exists in the parsed arguments object. This improves reliability when handling CLI flags.

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 514b527

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

This PR includes changesets to release 1 package
Name Type
@opennextjs/aws 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

pkg-pr-new Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 514b527

@vicb vicb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix @muhammadrizkirijalags! I pushed a follow-up commit on top of yours:

  • Moved the CLI arg parsing into utils/args.ts so it can be unit tested. parseArgs() now returns named fields instead of a loose key/value map.
  • --help and --dangerously-use-unsupported-next-version are now proper boolean flags. They're true when present and never take the next argument as a value. Value flags (--config-path, --node-externals) work as before.
  • Added unit tests in tests/utils/args.test.ts.
  • Added the flag to the CLI help text and fixed the missing newline at the end of the changeset.

@vicb

vicb commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

The e2e test fails because #1321 is not merged yet, so there is an (expected) error with Next 15

@vicb vicb added the run-e2e Run the E2E tests label Oct 21, 2026
@vicb
vicb merged commit b7b2123 into opennextjs:main Oct 21, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-e2e Run the E2E tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--dangerously-use-unsupported-next-version flag is ignored when passed without value

2 participants