Skip to content

Commit 79bb212

Browse files
chore: Use formatter for robustness (#15006)
Co-authored-by: Tee Ming <chewteeming01@gmail.com>
1 parent ad71199 commit 79bb212

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/adapter-vercel/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ export function resolve_runtime(default_key, override_key) {
121121
}
122122

123123
const valid_node_versions = [20, 22, 24];
124+
const formatter = new Intl.ListFormat('en', { type: 'disjunction' });
124125

125126
/** @returns {RuntimeKey} */
126127
function get_default_runtime() {
@@ -131,7 +132,7 @@ function get_default_runtime() {
131132

132133
if (!valid_node_versions.includes(major)) {
133134
throw new Error(
134-
`Unsupported Node.js version: ${process.version}. Please use Node ${valid_node_versions.slice(0, -1).join(', ')} or ${valid_node_versions.at(-1)} to build your project, or explicitly specify a runtime in your adapter configuration.`
135+
`Unsupported Node.js version: ${process.version}. Please use Node ${formatter.format(valid_node_versions.map((v) => `${v}`))} to build your project, or explicitly specify a runtime in your adapter configuration.`
135136
);
136137
}
137138

0 commit comments

Comments
 (0)