@sveltejs/adapter-vercel 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -9,12 +9,11 @@ const DEFAULT_FUNCTION_NAME = 'fn';
|
|
|
9
9
|
|
|
10
10
|
const get_default_runtime = () => {
|
|
11
11
|
const major = process.version.slice(1).split('.')[0];
|
|
12
|
-
if (major === '16') return 'nodejs16.x';
|
|
13
12
|
if (major === '18') return 'nodejs18.x';
|
|
14
13
|
if (major === '20') return 'nodejs20.x';
|
|
15
14
|
|
|
16
15
|
throw new Error(
|
|
17
|
-
`Unsupported Node.js version: ${process.version}. Please use Node
|
|
16
|
+
`Unsupported Node.js version: ${process.version}. Please use Node 18 or Node 20 to build your project, or explicitly specify a runtime in your adapter configuration.`
|
|
18
17
|
);
|
|
19
18
|
};
|
|
20
19
|
|
|
@@ -164,9 +163,9 @@ const plugin = function (defaults = {}) {
|
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
const node_runtime = /nodejs([0-9]+)\.x/.exec(runtime);
|
|
167
|
-
if (runtime !== 'edge' && (!node_runtime || node_runtime[1] <
|
|
166
|
+
if (runtime !== 'edge' && (!node_runtime || node_runtime[1] < 18)) {
|
|
168
167
|
throw new Error(
|
|
169
|
-
`Invalid runtime '${runtime}' for route ${route.id}. Valid runtimes are 'edge' and '
|
|
168
|
+
`Invalid runtime '${runtime}' for route ${route.id}. Valid runtimes are 'edge' and 'nodejs18.x' or higher ` +
|
|
170
169
|
'(see the Node.js Version section in your Vercel project settings for info on the currently supported versions).'
|
|
171
170
|
);
|
|
172
171
|
}
|