diff --git a/packages/runtime/src/helpers/analysis.ts b/packages/runtime/src/helpers/analysis.ts index 6cc2f985de..1228260e46 100644 --- a/packages/runtime/src/helpers/analysis.ts +++ b/packages/runtime/src/helpers/analysis.ts @@ -1,7 +1,5 @@ import fs, { existsSync } from 'fs' -import { extractExportedConstValue, UnsupportedValueError } from 'next/dist/build/analysis/extract-const-value' -import { parseModule } from 'next/dist/build/analysis/parse-module' import { relative } from 'pathe' // I have no idea what eslint is up to here but it gives an error @@ -81,6 +79,9 @@ export const validateConfigValue = (config: ApiConfig, apiFilePath: string): con return false } +let extractConstValue +let parseModule +let hasWarnedAboutNextVersion = false /** * Uses Next's swc static analysis to extract the config values from a file. */ @@ -88,6 +89,29 @@ export const extractConfigFromFile = async (apiFilePath: string): Promise