fix(nextjs): fix lint error - #674
Conversation
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
Simple formatting fix to get CI green