Skip to content

Commit 548a482

Browse files
committed
fix: try to import semver
1 parent ce20029 commit 548a482

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/runtime/src/templates/handlerUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { promisify } from 'util'
88
import { HandlerEvent, HandlerResponse } from '@netlify/functions'
99
import { http, https } from 'follow-redirects'
1010
import NextNodeServer from 'next/dist/server/next-server'
11+
import { satisfies } from 'semver'
1112

1213
import type { StaticRoute } from '../helpers/types'
1314

@@ -292,7 +293,7 @@ const nextPluginVersion = async () => {
292293
return packagePlugin?.version
293294
}
294295

295-
export const nextVersionNum = async (satisfies) => satisfies(await nextPluginVersion(), '13.3.3 - 13.4.9')
296+
export const nextVersionNum = async (sem?) => (sem ?? satisfies)(await nextPluginVersion(), '13.3.3 - 13.4.9')
296297

297298
export const getMatchedRoute = (
298299
paths: string,

packages/runtime/src/templates/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { NextConfig } from 'next'
66
import type { PrerenderManifest } from 'next/dist/build'
77
import type { BaseNextResponse } from 'next/dist/server/base-http'
88
import type { NodeRequestHandler, Options } from 'next/dist/server/next-server'
9-
import { satisfies } from 'semver'
109

1110
import { ExperimentalConfigWithLegacy } from '../helpers/utils'
1211

@@ -68,7 +67,7 @@ const getNetlifyNextServer = (NextServer: NextServerType) => {
6867
// conditionally use the prebundled React module
6968
// PrebundledReact should only apply when appDir is set it falls between the specified Next versions
7069
const { experimental }: NextConfigWithAppDir = this.nextConfig
71-
const version = await nextVersionNum(satisfies)
70+
const version = await nextVersionNum()
7271
if (experimental?.appDir && version) this.netlifyPrebundleReact(url, this.nextConfig, parsedUrl)
7372

7473
// intercept on-demand revalidation requests and handle with the Netlify API

0 commit comments

Comments
 (0)