Skip to content

Commit 0447d44

Browse files
committed
chore: added a comment about returning an unknown version of the next runtime
1 parent afe46a2 commit 0447d44

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/runtime/src/helpers/functionsMetaData.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ export const writeFunctionConfiguration = async (functionInfo: FunctionInfo) =>
3838
const nodeModulesPath = join(resolveModuleRoot(NEXT_PLUGIN), 'package.json')
3939

4040
const nextPluginVersion =
41-
(await getNextRuntimeVersion(nodeModulesPath, true)) || (await getNextRuntimeVersion(pluginPackagePath, false))
41+
(await getNextRuntimeVersion(nodeModulesPath, true)) ||
42+
(await getNextRuntimeVersion(pluginPackagePath, false)) ||
43+
// The runtime version should always be available, but if it's not, return 'unknown'
44+
'unknown'
4245

4346
const metadata = {
4447
config: {
4548
name: functionTitle,
46-
generator: `${NEXT_PLUGIN_NAME}@${nextPluginVersion || 'unknown'}`,
49+
generator: `${NEXT_PLUGIN_NAME}@${nextPluginVersion}`,
4750
},
4851
version: 1,
4952
}

0 commit comments

Comments
 (0)