Skip to content

fix(nextjs): fix lint error - #674

Open
leoortizz wants to merge 1 commit into
mainfrom
leoortizz_nextjsAdapterLintFix
Open

fix(nextjs): fix lint error#674
leoortizz wants to merge 1 commit into
mainfrom
leoortizz_nextjsAdapterLintFix

Conversation

@leoortizz

Copy link
Copy Markdown
Member

Simple formatting fix to get CI green

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request reformats the assignment of the isSafe variable in packages/@apphosting/adapter-nextjs/src/utils.ts. The review feedback correctly identifies a critical runtime issue where the referenced constant STRICTLY_SAFE_NEXTJS_VERSIONS contains an invalid semver range operator (==16.1.0), which will cause semver.satisfies to throw a TypeError when evaluating prerelease versions.

const isSafe = satisfies(version, SAFE_NEXTJS_VERSIONS) ||
const isSafe =
satisfies(version, SAFE_NEXTJS_VERSIONS) ||
(baseVersion && satisfies(baseVersion, STRICTLY_SAFE_NEXTJS_VERSIONS));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The constant STRICTLY_SAFE_NEXTJS_VERSIONS (referenced here) contains an invalid semver range operator ==16.1.0. In the semver package, == is not a valid operator and will cause semver.satisfies to throw a TypeError at runtime when a prerelease version is evaluated. Please update line 25 to use 16.1.0 or =16.1.0 instead of ==16.1.0.

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.

1 participant