Skip to content

SvelteKit adapter doesn't work with Vercel edge runtime #3706

@davidmytton

Description

@davidmytton

Using Arcjet with the SvelteKit adapter in the default auto mode works ok, however it fails if you switch the config to use the edge runtime.

To reproduce:

npm i -D @sveltejs/adapter-vercel

// svelte.config.js
import adapter from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://svelte.dev/docs/kit/integrations
	// for more information about preprocessors
	preprocess: vitePreprocess(),

	kit: {
		// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
		// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
		// See https://svelte.dev/docs/kit/adapters for more information about adapters.
		adapter: adapter({ runtime: 'edge' })
	}
};

export default config;
// lib/server/arcjet/index.ts

import { ARCJET_KEY } from '$env/static/private';
import arcjet, { detectBot, shield, slidingWindow, validateEmail } from '@arcjet/sveltekit';

export const middleware_aj = arcjet({
    key: ARCJET_KEY,
    rules: [
        shield({
            mode: 'LIVE'
        }),
        detectBot({
            mode: 'LIVE',
            allow: ['CATEGORY:SEARCH_ENGINE']
        }),
        slidingWindow({
            mode: 'LIVE',
            interval: 15,
            max: 25
        })
    ]
});

export const email_aj = arcjet({
    key: ARCJET_KEY,
    rules: [
        validateEmail({
            mode: "LIVE",
            deny: ["DISPOSABLE", "INVALID", "NO_MX_RECORDS", "FREE"],
        }),
    ],
});
// src/hooks.server.ts
import { redirect, type Handle } from '@sveltejs/kit';
import { middleware_aj } from '$lib/server/arcjet';
import { sequence } from '@sveltejs/kit/hooks';

const middleware: Handle = async ({ event, resolve }) => {

    const path = event.url.pathname;

    const decision = await middleware_aj.protect(event);

    if (decision.isDenied()) {
        if (decision.reason.isRateLimit()) {
            return redirect(303, '/rate-limited?redirect=' + path);
        }
        //,,,
    }

    console.log("Arcjet ID: " + decision.id);

    // ...
    return resolve(event);
};

export const handle = sequence(middleware);

Deploying this to Vercel fails the build:

[08:58:39.437] Retrieving list of deployment files...
[08:58:40.137] Downloading 28 deployment files...
[08:58:40.345] Restored build cache from previous deployment (AzoEKaYLNdmpRtgiSjk51YPLjtdu)
[08:58:40.436] Running build in Washington, D.C., USA (East) – iad1
[08:58:40.619] Running "vercel build"
[08:58:40.981] Vercel CLI 41.4.1
[08:58:41.978] Installing dependencies...
[08:58:43.060] 
[08:58:43.061] > sk-aj@0.0.1 prepare
[08:58:43.061] > svelte-kit sync || echo ''
[08:58:43.062] 
[08:58:44.164] 
[08:58:44.165] up to date in 2s
[08:58:44.166] 
[08:58:44.166] 23 packages are looking for funding
[08:58:44.166]   run `npm fund` for details
[08:58:44.200] Running "npm run build"
[08:58:44.307] 
[08:58:44.307] > sk-aj@0.0.1 build
[08:58:44.307] > vite build
[08:58:44.307] 
[08:58:47.805] �[36mvite v6.2.3 �[32mbuilding SSR bundle for production...�[36m�[39m
[08:58:47.847] transforming...
[08:58:48.686] �[32m✓�[39m 160 modules transformed.
[08:58:48.810] rendering chunks...
[08:58:49.422] �[36mvite v6.2.3 �[32mbuilding for production...�[36m�[39m
[08:58:49.427] transforming...
[08:58:50.079] �[32m✓�[39m 133 modules transformed.
[08:58:50.132] rendering chunks...
[08:58:50.171] computing gzip size...
[08:58:50.179] �[2m.svelte-kit/output/client/�[22m�[32m_app/version.json                       �[39m�[1m�[2m 0.03 kB�[22m�[1m�[22m�[2m │ gzip:  0.05 kB�[22m
[08:58:50.180] �[2m.svelte-kit/output/client/�[22m�[32m.vite/manifest.json                     �[39m�[1m�[2m 2.70 kB�[22m�[1m�[22m�[2m │ gzip:  0.53 kB�[22m
[08:58:50.180] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/B-V2mgnx.js       �[39m�[1m�[2m 0.03 kB�[22m�[1m�[22m�[2m │ gzip:  0.05 kB�[22m
[08:58:50.180] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/entry/start.B0Sretuq.js  �[39m�[1m�[2m 0.08 kB�[22m�[1m�[22m�[2m │ gzip:  0.09 kB�[22m
[08:58:50.181] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/nodes/2.DiFsFd8-.js      �[39m�[1m�[2m 0.32 kB�[22m�[1m�[22m�[2m │ gzip:  0.24 kB�[22m
[08:58:50.181] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/QNSWQJMG.js       �[39m�[1m�[2m 0.32 kB�[22m�[1m�[22m�[2m │ gzip:  0.25 kB�[22m
[08:58:50.181] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/nodes/0.iNoOEu36.js      �[39m�[1m�[2m 0.33 kB�[22m�[1m�[22m�[2m │ gzip:  0.24 kB�[22m
[08:58:50.181] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/DUyotZ0w.js       �[39m�[1m�[2m 0.99 kB�[22m�[1m�[22m�[2m │ gzip:  0.57 kB�[22m
[08:58:50.182] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/nodes/1.DR9W2HFJ.js      �[39m�[1m�[2m 1.05 kB�[22m�[1m�[22m�[2m │ gzip:  0.61 kB�[22m
[08:58:50.182] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/pcvDETT8.js       �[39m�[1m�[2m 2.47 kB�[22m�[1m�[22m�[2m │ gzip:  1.36 kB�[22m
[08:58:50.183] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/entry/app.zvB90sNT.js    �[39m�[1m�[2m 7.54 kB�[22m�[1m�[22m�[2m │ gzip:  3.60 kB�[22m
[08:58:50.183] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/CFVaXq-p.js       �[39m�[1m�[2m14.77 kB�[22m�[1m�[22m�[2m │ gzip:  5.96 kB�[22m
[08:58:50.183] �[2m.svelte-kit/output/client/�[22m�[36m_app/immutable/chunks/DGR-8w5K.js       �[39m�[1m�[2m32.36 kB�[22m�[1m�[22m�[2m │ gzip: 12.61 kB�[22m
[08:58:50.183] �[32m✓ built in 757ms�[39m
[08:58:50.735] �[2m.svelte-kit/output/server/�[22m�[32m.vite/manifest.json                 �[39m�[1m�[2m  1.99 kB�[22m�[1m�[22m
[08:58:50.736] �[2m.svelte-kit/output/server/�[22m�[36mentries/fallbacks/layout.svelte.js  �[39m�[1m�[2m  0.17 kB�[22m�[1m�[22m
[08:58:50.736] �[2m.svelte-kit/output/server/�[22m�[36mentries/pages/_page.svelte.js       �[39m�[1m�[2m  0.23 kB�[22m�[1m�[22m
[08:58:50.736] �[2m.svelte-kit/output/server/�[22m�[36minternal.js                         �[39m�[1m�[2m  0.31 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mentries/fallbacks/error.svelte.js   �[39m�[1m�[2m  1.87 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mchunks/index.js                     �[39m�[1m�[2m  2.26 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mchunks/hooks.server.js              �[39m�[1m�[2m  2.31 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mchunks/index2.js                    �[39m�[1m�[2m  3.61 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mchunks/exports.js                   �[39m�[1m�[2m  6.88 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mchunks/internal.js                  �[39m�[1m�[2m 49.79 kB�[22m�[1m�[22m
[08:58:50.737] �[2m.svelte-kit/output/server/�[22m�[36mindex.js                            �[39m�[1m�[2m104.45 kB�[22m�[1m�[22m
[08:58:50.737] �[32m✓ built in 2.90s�[39m
[08:58:50.738] 
[08:58:50.738] Run npm run preview to preview your production build locally.
[08:58:50.741] 
[08:58:50.741] > Using @sveltejs/adapter-vercel
[08:58:50.808] ✘ [ERROR] Could not resolve "node:process"
[08:58:50.808] 
[08:58:50.808]     node_modules/@arcjet/sveltekit/index.js:9:20:
[08:58:50.808]       9 │ import { env } from 'node:process';
[08:58:50.808]         ╵                     ~~~~~~~~~~~~~~
[08:58:50.808] 
[08:58:50.808]   The package "node:process" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.809] 
[08:58:50.811] ✘ [ERROR] Could not resolve "http2"
[08:58:50.812] 
[08:58:50.812]     node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.js:14:23:
[08:58:50.812]       14 │ import * as http2 from "http2";
[08:58:50.812]          ╵                        ~~~~~~~
[08:58:50.812] 
[08:58:50.812]   The package "http2" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.812] 
[08:58:50.818] ✘ [ERROR] Could not resolve "http2"
[08:58:50.818] 
[08:58:50.818]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:18:23:
[08:58:50.818]       18 │ import * as http2 from "http2";
[08:58:50.818]          ╵                        ~~~~~~~
[08:58:50.818] 
[08:58:50.818]   The package "http2" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.818] 
[08:58:50.818] ✘ [ERROR] Could not resolve "http"
[08:58:50.818] 
[08:58:50.819]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:19:22:
[08:58:50.819]       19 │ import * as http from "http";
[08:58:50.819]          ╵                       ~~~~~~
[08:58:50.819] 
[08:58:50.819]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.819] 
[08:58:50.819] ✘ [ERROR] Could not resolve "https"
[08:58:50.819] 
[08:58:50.819]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:20:23:
[08:58:50.819]       20 │ import * as https from "https";
[08:58:50.819]          ╵                        ~~~~~~~
[08:58:50.819] 
[08:58:50.819]   The package "https" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.819] 
[08:58:50.841] ✘ [ERROR] Could not resolve "zlib"
[08:58:50.841] 
[08:58:50.842]     node_modules/@connectrpc/connect-node/dist/esm/compression.js:14:22:
[08:58:50.843]       14 │ import * as zlib from "zlib";
[08:58:50.843]          ╵                       ~~~~~~
[08:58:50.843] 
[08:58:50.843]   The package "zlib" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.844] 
[08:58:50.844] ✘ [ERROR] Could not resolve "http2"
[08:58:50.844] 
[08:58:50.844]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:14:23:
[08:58:50.845]       14 │ import * as http2 from "http2";
[08:58:50.845]          ╵                        ~~~~~~~
[08:58:50.845] 
[08:58:50.845]   The package "http2" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.845] 
[08:58:50.846] ✘ [ERROR] Could not resolve "http"
[08:58:50.846] 
[08:58:50.846]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:15:22:
[08:58:50.846]       15 │ import * as http from "http";
[08:58:50.846]          ╵                       ~~~~~~
[08:58:50.847] 
[08:58:50.847]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.847] 
[08:58:50.847] ✘ [ERROR] Could not resolve "https"
[08:58:50.847] 
[08:58:50.848]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:16:23:
[08:58:50.848]       16 │ import * as https from "https";
[08:58:50.848]          ╵                        ~~~~~~~
[08:58:50.848] 
[08:58:50.848]   The package "https" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.849] 
[08:58:50.920] ✘ [ERROR] Could not resolve "net"
[08:58:50.920] 
[08:58:50.920]     node_modules/undici/lib/client.js:8:20:
[08:58:50.921]       8 │ const net = require('net')
[08:58:50.921]         ╵                     ~~~~~
[08:58:50.921] 
[08:58:50.921]   The package "net" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.922] 
[08:58:50.926] ✘ [ERROR] Could not resolve "http"
[08:58:50.927] 
[08:58:50.927]     node_modules/undici/lib/client.js:9:21:
[08:58:50.927]       9 │ const http = require('http')
[08:58:50.927]         ╵                      ~~~~~~
[08:58:50.928] 
[08:58:50.928]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.928] 
[08:58:50.928] ✘ [ERROR] Could not resolve "stream"
[08:58:50.928] 
[08:58:50.928]     node_modules/undici/lib/client.js:10:29:
[08:58:50.929]       10 │ const { pipeline } = require('stream')
[08:58:50.929]          ╵                              ~~~~~~~~
[08:58:50.929] 
[08:58:50.929]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.930] 
[08:58:50.933] ✘ [ERROR] Could not resolve "stream/web"
[08:58:50.934] 
[08:58:50.934]     node_modules/undici/lib/fetch/body.js:43:29:
[08:58:50.934]       43 │     ReadableStream = require('stream/web').ReadableStream
[08:58:50.934]          ╵                              ~~~~~~~~~~~~
[08:58:50.934] 
[08:58:50.935]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.935] 
[08:58:50.935] ✘ [ERROR] Could not resolve "worker_threads"
[08:58:50.935] 
[08:58:50.936]     node_modules/undici/lib/fetch/constants.js:3:57:
[08:58:50.936]       3 │ ... MessageChannel, receiveMessageOnPort } = require('worker_threads')
[08:58:50.936]         ╵                                                      ~~~~~~~~~~~~~~~~
[08:58:50.936] 
[08:58:50.936]   The package "worker_threads" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.937] 
[08:58:50.940] ✘ [ERROR] Could not resolve "http"
[08:58:50.940] 
[08:58:50.940]     node_modules/undici/lib/core/util.js:5:36:
[08:58:50.940]       5 │ const { IncomingMessage } = require('http')
[08:58:50.941]         ╵                                     ~~~~~~
[08:58:50.941] 
[08:58:50.941]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.941] 
[08:58:50.969] ✘ [ERROR] Could not resolve "stream"
[08:58:50.969] 
[08:58:50.970]     node_modules/undici/lib/core/util.js:6:23:
[08:58:50.970]       6 │ const stream = require('stream')
[08:58:50.970]         ╵                        ~~~~~~~~
[08:58:50.970] 
[08:58:50.970]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.971] 
[08:58:50.971] ✘ [ERROR] Could not resolve "net"
[08:58:50.971] 
[08:58:50.971]     node_modules/undici/lib/core/util.js:7:20:
[08:58:50.971]       7 │ const net = require('net')
[08:58:50.971]         ╵                     ~~~~~
[08:58:50.971] 
[08:58:50.972]   The package "net" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.972] 
[08:58:50.972] ✘ [ERROR] Could not resolve "querystring"
[08:58:50.972] 
[08:58:50.972]     node_modules/undici/lib/core/util.js:11:30:
[08:58:50.973]       11 │ const { stringify } = require('querystring')
[08:58:50.973]          ╵                               ~~~~~~~~~~~~~
[08:58:50.973] 
[08:58:50.973]   The package "querystring" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.973] 
[08:58:50.973] ✘ [ERROR] Could not resolve "stream/web"
[08:58:50.973] 
[08:58:50.974]     node_modules/undici/lib/core/util.js:381:29:
[08:58:50.974]       381 │     ReadableStream = require('stream/web').ReadableStream
[08:58:50.974]           ╵                              ~~~~~~~~~~~~
[08:58:50.974] 
[08:58:50.974]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.974] 
[08:58:50.974] ✘ [ERROR] Could not resolve "net"
[08:58:50.975] 
[08:58:50.975]     node_modules/undici/lib/core/connect.js:3:20:
[08:58:50.975]       3 │ const net = require('net')
[08:58:50.975]         ╵                     ~~~~~
[08:58:50.975] 
[08:58:50.975]   The package "net" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.975] 
[08:58:50.977] ✘ [ERROR] Could not resolve "tls"
[08:58:50.977] 
[08:58:50.977]     node_modules/undici/lib/core/connect.js:89:22:
[08:58:50.977]       89 │         tls = require('tls')
[08:58:50.977]          ╵                       ~~~~~
[08:58:50.977] 
[08:58:50.978]   The package "tls" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.978] 
[08:58:50.978] ✘ [ERROR] Could not resolve "node:stream"
[08:58:50.978] 
[08:58:50.978]     node_modules/@fastify/busboy/lib/main.js:3:31:
[08:58:50.978]       3 │ const WritableStream = require('node:stream').Writable
[08:58:50.978]         ╵                                ~~~~~~~~~~~~~
[08:58:50.978] 
[08:58:50.979]   The package "node:stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.979] 
[08:58:50.979] ✘ [ERROR] Could not resolve "perf_hooks"
[08:58:50.979] 
[08:58:50.979]     node_modules/undici/lib/fetch/util.js:5:32:
[08:58:50.979]       5 │ const { performance } = require('perf_hooks')
[08:58:50.979]         ╵                                 ~~~~~~~~~~~~
[08:58:50.979] 
[08:58:50.980]   The package "perf_hooks" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.980] 
[08:58:50.980] ✘ [ERROR] Could not resolve "stream/web"
[08:58:50.980] 
[08:58:50.980]     node_modules/undici/lib/fetch/util.js:970:29:
[08:58:50.980]       970 │     ReadableStream = require('stream/web').ReadableStream
[08:58:50.980]           ╵                              ~~~~~~~~~~~~
[08:58:50.980] 
[08:58:50.981]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.981] 
[08:58:50.981] ✘ [ERROR] Could not resolve "url"
[08:58:50.981] 
[08:58:50.981]     node_modules/undici/lib/proxy-agent.js:4:24:
[08:58:50.981]       4 │ const { URL } = require('url')
[08:58:50.988]         ╵                         ~~~~~
[08:58:50.996] 
[08:58:50.996]   The package "url" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.996] 
[08:58:50.996] ✘ [ERROR] Could not resolve "zlib"
[08:58:50.997] 
[08:58:50.997]     node_modules/undici/lib/fetch/index.js:14:21:
[08:58:50.997]       14 │ const zlib = require('zlib')
[08:58:50.997]          ╵                      ~~~~~~
[08:58:50.997] 
[08:58:50.997]   The package "zlib" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.997] 
[08:58:50.997] ✘ [ERROR] Could not resolve "stream"
[08:58:50.997] 
[08:58:50.997]     node_modules/undici/lib/fetch/index.js:58:39:
[08:58:50.997]       58 │ const { Readable, pipeline } = require('stream')
[08:58:50.997]          ╵                                        ~~~~~~~~
[08:58:50.997] 
[08:58:50.997]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.997] 
[08:58:50.997] ✘ [ERROR] Could not resolve "stream/web"
[08:58:50.997] 
[08:58:50.997]     node_modules/undici/lib/fetch/index.js:61:36:
[08:58:50.997]       61 │ const { TransformStream } = require('stream/web')
[08:58:50.997]          ╵                                     ~~~~~~~~~~~~
[08:58:50.997] 
[08:58:50.997]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.997] 
[08:58:50.997] ✘ [ERROR] Could not resolve "http"
[08:58:50.997] 
[08:58:50.997]     node_modules/undici/lib/fetch/index.js:64:33:
[08:58:50.997]       64 │ const { STATUS_CODES } = require('http')
[08:58:50.997]          ╵                                  ~~~~~~
[08:58:50.997] 
[08:58:50.997]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:50.997] 
[08:58:51.029] ✘ [ERROR] Could not resolve "stream/web"
[08:58:51.029] 
[08:58:51.029]     node_modules/undici/lib/fetch/response.js:30:60:
[08:58:51.029]       30 │ ... globalThis.ReadableStream || require('stream/web').ReadableStream
[08:58:51.029]          ╵                                          ~~~~~~~~~~~~
[08:58:51.029] 
[08:58:51.030]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.030] 
[08:58:51.031] ✘ [ERROR] Could not resolve "stream/web"
[08:58:51.031] 
[08:58:51.032]     node_modules/undici/lib/fetch/request.js:520:34:
[08:58:51.032]       520 │         TransformStream = require('stream/web').TransformStream
[08:58:51.032]           ╵                                   ~~~~~~~~~~~~
[08:58:51.032] 
[08:58:51.032]   The package "stream/web" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.032] 
[08:58:51.035] ✘ [ERROR] Could not resolve "stream"
[08:58:51.035] 
[08:58:51.035]     node_modules/undici/lib/api/api-stream.js:3:42:
[08:58:51.036]       3 │ const { finished, PassThrough } = require('stream')
[08:58:51.036]         ╵                                           ~~~~~~~~
[08:58:51.036] 
[08:58:51.036]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.036] 
[08:58:51.037] ✘ [ERROR] Could not resolve "http"
[08:58:51.037] 
[08:58:51.037]     node_modules/undici/lib/mock/mock-utils.js:12:33:
[08:58:51.037]       12 │ const { STATUS_CODES } = require('http')
[08:58:51.037]          ╵                                  ~~~~~~
[08:58:51.038] 
[08:58:51.038]   The package "http" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.038] 
[08:58:51.042] ✘ [ERROR] Could not resolve "stream"
[08:58:51.042] 
[08:58:51.042]     node_modules/undici/lib/api/api-pipeline.js:7:12:
[08:58:51.042]       7 │ } = require('stream')
[08:58:51.042]         ╵             ~~~~~~~~
[08:58:51.042] 
[08:58:51.042]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.042] 
[08:58:51.042] ✘ [ERROR] Could not resolve "stream"
[08:58:51.043] 
[08:58:51.043]     node_modules/undici/lib/mock/pending-interceptors-formatter.js:3:30:
[08:58:51.043]       3 │ const { Transform } = require('stream')
[08:58:51.043]         ╵                               ~~~~~~~~
[08:58:51.043] 
[08:58:51.043]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.043] 
[08:58:51.043] ✘ [ERROR] Could not resolve "console"
[08:58:51.044] 
[08:58:51.044]     node_modules/undici/lib/mock/pending-interceptors-formatter.js:4:28:
[08:58:51.044]       4 │ const { Console } = require('console')
[08:58:51.044]         ╵                             ~~~~~~~~~
[08:58:51.044] 
[08:58:51.044]   The package "console" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.044] 
[08:58:51.044] ✘ [ERROR] Could not resolve "node:stream"
[08:58:51.045] 
[08:58:51.045]     node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:3:31:
[08:58:51.045]       3 │ const WritableStream = require('node:stream').Writable
[08:58:51.045]         ╵                                ~~~~~~~~~~~~~
[08:58:51.045] 
[08:58:51.045]   The package "node:stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.045] 
[08:58:51.047] ✘ [ERROR] Could not resolve "node:stream"
[08:58:51.047] 
[08:58:51.048]     node_modules/@fastify/busboy/lib/types/multipart.js:10:29:
[08:58:51.048]       10 │ const { Readable } = require('node:stream')
[08:58:51.048]          ╵                              ~~~~~~~~~~~~~
[08:58:51.048] 
[08:58:51.048]   The package "node:stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.048] 
[08:58:51.048] ✘ [ERROR] Could not resolve "string_decoder"
[08:58:51.048] 
[08:58:51.048]     node_modules/undici/lib/fileapi/util.js:15:34:
[08:58:51.048]       15 │ const { StringDecoder } = require('string_decoder')
[08:58:51.048]          ╵                                   ~~~~~~~~~~~~~~~~
[08:58:51.048] 
[08:58:51.049]   The package "string_decoder" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.049] 
[08:58:51.054] ✘ [ERROR] Could not resolve "worker_threads"
[08:58:51.054] 
[08:58:51.054]     node_modules/undici/lib/websocket/events.js:5:32:
[08:58:51.054]       5 │ const { MessagePort } = require('worker_threads')
[08:58:51.054]         ╵                                 ~~~~~~~~~~~~~~~~
[08:58:51.055] 
[08:58:51.055]   The package "worker_threads" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.055] 
[08:58:51.055] ✘ [ERROR] Could not resolve "node:stream"
[08:58:51.055] 
[08:58:51.055]     node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js:4:31:
[08:58:51.055]       4 │ const ReadableStream = require('node:stream').Readable
[08:58:51.055]         ╵                                ~~~~~~~~~~~~~
[08:58:51.055] 
[08:58:51.055]   The package "node:stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.056] 
[08:58:51.056] ✘ [ERROR] Could not resolve "diagnostics_channel"
[08:58:51.056] 
[08:58:51.056]     node_modules/undici/lib/websocket/connection.js:3:35:
[08:58:51.056]       3 │ const diagnosticsChannel = require('diagnostics_channel')
[08:58:51.056]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~
[08:58:51.056] 
[08:58:51.056]   The package "diagnostics_channel" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.056] 
[08:58:51.058] ✘ [ERROR] Could not resolve "stream"
[08:58:51.059] 
[08:58:51.059]     node_modules/undici/lib/websocket/receiver.js:3:29:
[08:58:51.059]       3 │ const { Writable } = require('stream')
[08:58:51.059]         ╵                              ~~~~~~~~
[08:58:51.059] 
[08:58:51.059]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.059] 
[08:58:51.059] ✘ [ERROR] Could not resolve "diagnostics_channel"
[08:58:51.059] 
[08:58:51.059]     node_modules/undici/lib/websocket/receiver.js:4:35:
[08:58:51.060]       4 │ const diagnosticsChannel = require('diagnostics_channel')
[08:58:51.060]         ╵                                    ~~~~~~~~~~~~~~~~~~~~~
[08:58:51.060] 
[08:58:51.060]   The package "diagnostics_channel" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.060] 
[08:58:51.062] ✘ [ERROR] Could not resolve "stream"
[08:58:51.063] 
[08:58:51.063]     node_modules/undici/lib/api/readable.js:6:29:
[08:58:51.063]       6 │ const { Readable } = require('stream')
[08:58:51.063]         ╵                              ~~~~~~~~
[08:58:51.063] 
[08:58:51.063]   The package "stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
[08:58:51.064] 
[08:58:51.070] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "node:process"�[0m
[08:58:51.071] 
[08:58:51.071]     node_modules/@arcjet/sveltekit/index.js:9:20:
[08:58:51.071] �[37m      9 │ import { env } from �[32m'node:process'�[37m;
[08:58:51.071]         ╵                     �[32m~~~~~~~~~~~~~~�[0m
[08:58:51.071] 
[08:58:51.071]   Cannot use "node:process" when deploying to Vercel Edge Functions.
[08:58:51.071] 
[08:58:51.071] 
[08:58:51.071] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "zlib"�[0m
[08:58:51.071] 
[08:58:51.071]     node_modules/@connectrpc/connect-node/dist/esm/compression.js:14:22:
[08:58:51.071] �[37m      14 │ import * as zlib from �[32m"zlib"�[37m;
[08:58:51.072]          ╵                       �[32m~~~~~~�[0m
[08:58:51.072] 
[08:58:51.072]   Cannot use "zlib" when deploying to Vercel Edge Functions.
[08:58:51.072] 
[08:58:51.072] 
[08:58:51.072] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http2"�[0m
[08:58:51.072] 
[08:58:51.072]     node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.js:14:23:
[08:58:51.072] �[37m      14 │ import * as http2 from �[32m"http2"�[37m;
[08:58:51.072]          ╵                        �[32m~~~~~~~�[0m
[08:58:51.072] 
[08:58:51.072]   Cannot use "http2" when deploying to Vercel Edge Functions.
[08:58:51.072] 
[08:58:51.072] 
[08:58:51.072] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http2"�[0m
[08:58:51.072] 
[08:58:51.073]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:18:23:
[08:58:51.073] �[37m      18 │ import * as http2 from �[32m"http2"�[37m;
[08:58:51.073]          ╵                        �[32m~~~~~~~�[0m
[08:58:51.073] 
[08:58:51.073]   Cannot use "http2" when deploying to Vercel Edge Functions.
[08:58:51.073] 
[08:58:51.073] 
[08:58:51.073] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.073] 
[08:58:51.073]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:19:22:
[08:58:51.073] �[37m      19 │ import * as http from �[32m"http"�[37m;
[08:58:51.073]          ╵                       �[32m~~~~~~�[0m
[08:58:51.073] 
[08:58:51.073]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.073] 
[08:58:51.073] 
[08:58:51.074] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "https"�[0m
[08:58:51.074] 
[08:58:51.074]     node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js:20:23:
[08:58:51.074] �[37m      20 │ import * as https from �[32m"https"�[37m;
[08:58:51.074]          ╵                        �[32m~~~~~~~�[0m
[08:58:51.074] 
[08:58:51.074]   Cannot use "https" when deploying to Vercel Edge Functions.
[08:58:51.074] 
[08:58:51.074] 
[08:58:51.074] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http2"�[0m
[08:58:51.074] 
[08:58:51.074]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:14:23:
[08:58:51.074] �[37m      14 │ import * as http2 from �[32m"http2"�[37m;
[08:58:51.074]          ╵                        �[32m~~~~~~~�[0m
[08:58:51.074] 
[08:58:51.075]   Cannot use "http2" when deploying to Vercel Edge Functions.
[08:58:51.075] 
[08:58:51.075] 
[08:58:51.075] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.075] 
[08:58:51.075]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:15:22:
[08:58:51.075] �[37m      15 │ import * as http from �[32m"http"�[37m;
[08:58:51.075]          ╵                       �[32m~~~~~~�[0m
[08:58:51.075] 
[08:58:51.075]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.075] 
[08:58:51.075] 
[08:58:51.075] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "https"�[0m
[08:58:51.075] 
[08:58:51.075]     node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js:16:23:
[08:58:51.075] �[37m      16 │ import * as https from �[32m"https"�[37m;
[08:58:51.075]          ╵                        �[32m~~~~~~~�[0m
[08:58:51.075] 
[08:58:51.081]   Cannot use "https" when deploying to Vercel Edge Functions.
[08:58:51.081] 
[08:58:51.081] 
[08:58:51.081] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "node:stream"�[0m
[08:58:51.081] 
[08:58:51.081]     node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:3:31:
[08:58:51.081] �[37m      3 │ const WritableStream = require(�[32m'node:stream'�[37m).Writable
[08:58:51.081]         ╵                                �[32m~~~~~~~~~~~~~�[0m
[08:58:51.082] 
[08:58:51.082]   Cannot use "node:stream" when deploying to Vercel Edge Functions.
[08:58:51.082] 
[08:58:51.082] 
[08:58:51.082] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "node:stream"�[0m
[08:58:51.082] 
[08:58:51.082]     node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js:4:31:
[08:58:51.082] �[37m      4 │ const ReadableStream = require(�[32m'node:stream'�[37m).Readable
[08:58:51.082]         ╵                                �[32m~~~~~~~~~~~~~�[0m
[08:58:51.082] 
[08:58:51.082]   Cannot use "node:stream" when deploying to Vercel Edge Functions.
[08:58:51.082] 
[08:58:51.082] 
[08:58:51.082] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "node:stream"�[0m
[08:58:51.082] 
[08:58:51.082]     node_modules/@fastify/busboy/lib/main.js:3:31:
[08:58:51.083] �[37m      3 │ const WritableStream = require(�[32m'node:stream'�[37m).Writable
[08:58:51.083]         ╵                                �[32m~~~~~~~~~~~~~�[0m
[08:58:51.083] 
[08:58:51.083]   Cannot use "node:stream" when deploying to Vercel Edge Functions.
[08:58:51.083] 
[08:58:51.083] 
[08:58:51.083] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "node:stream"�[0m
[08:58:51.083] 
[08:58:51.083]     node_modules/@fastify/busboy/lib/types/multipart.js:10:29:
[08:58:51.083] �[37m      10 │ const { Readable } = require(�[32m'node:stream'�[37m)
[08:58:51.083]          ╵                              �[32m~~~~~~~~~~~~~�[0m
[08:58:51.083] 
[08:58:51.083]   Cannot use "node:stream" when deploying to Vercel Edge Functions.
[08:58:51.083] 
[08:58:51.083] 
[08:58:51.083] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.084] 
[08:58:51.084]     node_modules/undici/lib/api/api-pipeline.js:7:12:
[08:58:51.084] �[37m      7 │ } = require(�[32m'stream'�[37m)
[08:58:51.084]         ╵             �[32m~~~~~~~~�[0m
[08:58:51.084] 
[08:58:51.084]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.084] 
[08:58:51.085] 
[08:58:51.085] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.085] 
[08:58:51.085]     node_modules/undici/lib/api/api-stream.js:3:42:
[08:58:51.085] �[37m      3 │ const { finished, PassThrough } = require(�[32m'stream'�[37m)
[08:58:51.085]         ╵                                           �[32m~~~~~~~~�[0m
[08:58:51.085] 
[08:58:51.085]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.085] 
[08:58:51.085] 
[08:58:51.085] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.086] 
[08:58:51.086]     node_modules/undici/lib/api/readable.js:6:29:
[08:58:51.086] �[37m      6 │ const { Readable } = require(�[32m'stream'�[37m)
[08:58:51.086]         ╵                              �[32m~~~~~~~~�[0m
[08:58:51.086] 
[08:58:51.086]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.086] 
[08:58:51.086] 
[08:58:51.086] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "net"�[0m
[08:58:51.086] 
[08:58:51.086]     node_modules/undici/lib/client.js:8:20:
[08:58:51.086] �[37m      8 │ const net = require(�[32m'net'�[37m)
[08:58:51.086]         ╵                     �[32m~~~~~�[0m
[08:58:51.086] 
[08:58:51.086]   Cannot use "net" when deploying to Vercel Edge Functions.
[08:58:51.086] 
[08:58:51.087] 
[08:58:51.087] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.087] 
[08:58:51.087]     node_modules/undici/lib/client.js:9:21:
[08:58:51.087] �[37m      9 │ const http = require(�[32m'http'�[37m)
[08:58:51.087]         ╵                      �[32m~~~~~~�[0m
[08:58:51.087] 
[08:58:51.087]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.087] 
[08:58:51.087] 
[08:58:51.087] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.087] 
[08:58:51.087]     node_modules/undici/lib/client.js:10:29:
[08:58:51.087] �[37m      10 │ const { pipeline } = require(�[32m'stream'�[37m)
[08:58:51.087]          ╵                              �[32m~~~~~~~~�[0m
[08:58:51.087] 
[08:58:51.087]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.088] 
[08:58:51.088] 
[08:58:51.088] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "net"�[0m
[08:58:51.088] 
[08:58:51.088]     node_modules/undici/lib/core/connect.js:3:20:
[08:58:51.088] �[37m      3 │ const net = require(�[32m'net'�[37m)
[08:58:51.088]         ╵                     �[32m~~~~~�[0m
[08:58:51.088] 
[08:58:51.088]   Cannot use "net" when deploying to Vercel Edge Functions.
[08:58:51.088] 
[08:58:51.088] 
[08:58:51.088] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "tls"�[0m
[08:58:51.088] 
[08:58:51.088]     node_modules/undici/lib/core/connect.js:89:22:
[08:58:51.088] �[37m      89 │         tls = require(�[32m'tls'�[37m)
[08:58:51.089]          ╵                       �[32m~~~~~�[0m
[08:58:51.089] 
[08:58:51.089]   Cannot use "tls" when deploying to Vercel Edge Functions.
[08:58:51.089] 
[08:58:51.089] 
[08:58:51.089] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.089] 
[08:58:51.089]     node_modules/undici/lib/core/util.js:5:36:
[08:58:51.089] �[37m      5 │ const { IncomingMessage } = require(�[32m'http'�[37m)
[08:58:51.089]         ╵                                     �[32m~~~~~~�[0m
[08:58:51.089] 
[08:58:51.089]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.089] 
[08:58:51.089] 
[08:58:51.089] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.089] 
[08:58:51.089]     node_modules/undici/lib/core/util.js:6:23:
[08:58:51.090] �[37m      6 │ const stream = require(�[32m'stream'�[37m)
[08:58:51.090]         ╵                        �[32m~~~~~~~~�[0m
[08:58:51.090] 
[08:58:51.090]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.090] 
[08:58:51.090] 
[08:58:51.090] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "net"�[0m
[08:58:51.090] 
[08:58:51.090]     node_modules/undici/lib/core/util.js:7:20:
[08:58:51.090] �[37m      7 │ const net = require(�[32m'net'�[37m)
[08:58:51.090]         ╵                     �[32m~~~~~�[0m
[08:58:51.090] 
[08:58:51.090]   Cannot use "net" when deploying to Vercel Edge Functions.
[08:58:51.090] 
[08:58:51.090] 
[08:58:51.090] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "querystring"�[0m
[08:58:51.091] 
[08:58:51.091]     node_modules/undici/lib/core/util.js:11:30:
[08:58:51.091] �[37m      11 │ const { stringify } = require(�[32m'querystring'�[37m)
[08:58:51.091]          ╵                               �[32m~~~~~~~~~~~~~�[0m
[08:58:51.091] 
[08:58:51.091]   Cannot use "querystring" when deploying to Vercel Edge Functions.
[08:58:51.091] 
[08:58:51.091] 
[08:58:51.091] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.091] 
[08:58:51.091]     node_modules/undici/lib/core/util.js:381:29:
[08:58:51.091] �[37m      381 │     ReadableStream = require(�[32m'stream/web'�[37m).ReadableStream
[08:58:51.091]           ╵                              �[32m~~~~~~~~~~~~�[0m
[08:58:51.091] 
[08:58:51.091]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.091] 
[08:58:51.091] 
[08:58:51.091] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.091] 
[08:58:51.091]     node_modules/undici/lib/fetch/body.js:43:29:
[08:58:51.091] �[37m      43 │     ReadableStream = require(�[32m'stream/web'�[37m).ReadableStream
[08:58:51.092]          ╵                              �[32m~~~~~~~~~~~~�[0m
[08:58:51.093] 
[08:58:51.093]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.093] 
[08:58:51.093] 
[08:58:51.093] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "worker_threads"�[0m
[08:58:51.093] 
[08:58:51.093]     node_modules/undici/lib/fetch/constants.js:3:57:
[08:58:51.093] �[37m      3 │ ... MessageChannel, receiveMessageOnPort } = require(�[32m'worker_threads'�[37m)
[08:58:51.093]         ╵                                                      �[32m~~~~~~~~~~~~~~~~�[0m
[08:58:51.093] 
[08:58:51.093]   Cannot use "worker_threads" when deploying to Vercel Edge Functions.
[08:58:51.093] 
[08:58:51.093] 
[08:58:51.093] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "zlib"�[0m
[08:58:51.094] 
[08:58:51.094]     node_modules/undici/lib/fetch/index.js:14:21:
[08:58:51.094] �[37m      14 │ const zlib = require(�[32m'zlib'�[37m)
[08:58:51.094]          ╵                      �[32m~~~~~~�[0m
[08:58:51.094] 
[08:58:51.094]   Cannot use "zlib" when deploying to Vercel Edge Functions.
[08:58:51.094] 
[08:58:51.094] 
[08:58:51.094] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.094] 
[08:58:51.094]     node_modules/undici/lib/fetch/index.js:58:39:
[08:58:51.094] �[37m      58 │ const { Readable, pipeline } = require(�[32m'stream'�[37m)
[08:58:51.094]          ╵                                        �[32m~~~~~~~~�[0m
[08:58:51.094] 
[08:58:51.094]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.094] 
[08:58:51.095] 
[08:58:51.095] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.095] 
[08:58:51.095]     node_modules/undici/lib/fetch/index.js:61:36:
[08:58:51.095] �[37m      61 │ const { TransformStream } = require(�[32m'stream/web'�[37m)
[08:58:51.095]          ╵                                     �[32m~~~~~~~~~~~~�[0m
[08:58:51.095] 
[08:58:51.095]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.095] 
[08:58:51.095] 
[08:58:51.095] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.095] 
[08:58:51.095]     node_modules/undici/lib/fetch/index.js:64:33:
[08:58:51.095] �[37m      64 │ const { STATUS_CODES } = require(�[32m'http'�[37m)
[08:58:51.095]          ╵                                  �[32m~~~~~~�[0m
[08:58:51.095] 
[08:58:51.095]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.095] 
[08:58:51.095] 
[08:58:51.095] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.096] 
[08:58:51.096]     node_modules/undici/lib/fetch/request.js:520:34:
[08:58:51.096] �[37m      520 │         TransformStream = require(�[32m'stream/web'�[37m).TransformStream
[08:58:51.096]           ╵                                   �[32m~~~~~~~~~~~~�[0m
[08:58:51.096] 
[08:58:51.096]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.096] 
[08:58:51.096] 
[08:58:51.096] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.096] 
[08:58:51.096]     node_modules/undici/lib/fetch/response.js:30:60:
[08:58:51.096] �[37m      30 │ ... globalThis.ReadableStream || require(�[32m'stream/web'�[37m).ReadableStream
[08:58:51.096]          ╵                                          �[32m~~~~~~~~~~~~�[0m
[08:58:51.096] 
[08:58:51.096]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.096] 
[08:58:51.096] 
[08:58:51.096] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "perf_hooks"�[0m
[08:58:51.096] 
[08:58:51.096]     node_modules/undici/lib/fetch/util.js:5:32:
[08:58:51.096] �[37m      5 │ const { performance } = require(�[32m'perf_hooks'�[37m)
[08:58:51.096]         ╵                                 �[32m~~~~~~~~~~~~�[0m
[08:58:51.097] 
[08:58:51.097]   Cannot use "perf_hooks" when deploying to Vercel Edge Functions.
[08:58:51.097] 
[08:58:51.097] 
[08:58:51.097] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream/web"�[0m
[08:58:51.097] 
[08:58:51.097]     node_modules/undici/lib/fetch/util.js:970:29:
[08:58:51.097] �[37m      970 │     ReadableStream = require(�[32m'stream/web'�[37m).ReadableStream
[08:58:51.097]           ╵                              �[32m~~~~~~~~~~~~�[0m
[08:58:51.097] 
[08:58:51.097]   Cannot use "stream/web" when deploying to Vercel Edge Functions.
[08:58:51.097] 
[08:58:51.097] 
[08:58:51.097] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "string_decoder"�[0m
[08:58:51.097] 
[08:58:51.097]     node_modules/undici/lib/fileapi/util.js:15:34:
[08:58:51.097] �[37m      15 │ const { StringDecoder } = require(�[32m'string_decoder'�[37m)
[08:58:51.097]          ╵                                   �[32m~~~~~~~~~~~~~~~~�[0m
[08:58:51.097] 
[08:58:51.097]   Cannot use "string_decoder" when deploying to Vercel Edge Functions.
[08:58:51.097] 
[08:58:51.097] 
[08:58:51.097] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "http"�[0m
[08:58:51.098] 
[08:58:51.098]     node_modules/undici/lib/mock/mock-utils.js:12:33:
[08:58:51.098] �[37m      12 │ const { STATUS_CODES } = require(�[32m'http'�[37m)
[08:58:51.098]          ╵                                  �[32m~~~~~~�[0m
[08:58:51.098] 
[08:58:51.098]   Cannot use "http" when deploying to Vercel Edge Functions.
[08:58:51.098] 
[08:58:51.098] 
[08:58:51.098] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.098] 
[08:58:51.098]     node_modules/undici/lib/mock/pending-interceptors-formatter.js:3:30:
[08:58:51.098] �[37m      3 │ const { Transform } = require(�[32m'stream'�[37m)
[08:58:51.098]         ╵                               �[32m~~~~~~~~�[0m
[08:58:51.098] 
[08:58:51.098]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.098] 
[08:58:51.098] 
[08:58:51.098] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "console"�[0m
[08:58:51.098] 
[08:58:51.098]     node_modules/undici/lib/mock/pending-interceptors-formatter.js:4:28:
[08:58:51.099] �[37m      4 │ const { Console } = require(�[32m'console'�[37m)
[08:58:51.099]         ╵                             �[32m~~~~~~~~~�[0m
[08:58:51.099] 
[08:58:51.099]   Cannot use "console" when deploying to Vercel Edge Functions.
[08:58:51.099] 
[08:58:51.099] 
[08:58:51.100] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "url"�[0m
[08:58:51.100] 
[08:58:51.100]     node_modules/undici/lib/proxy-agent.js:4:24:
[08:58:51.100] �[37m      4 │ const { URL } = require(�[32m'url'�[37m)
[08:58:51.100]         ╵                         �[32m~~~~~�[0m
[08:58:51.100] 
[08:58:51.100]   Cannot use "url" when deploying to Vercel Edge Functions.
[08:58:51.100] 
[08:58:51.100] 
[08:58:51.100] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "diagnostics_channel"�[0m
[08:58:51.100] 
[08:58:51.101]     node_modules/undici/lib/websocket/connection.js:3:35:
[08:58:51.101] �[37m      3 │ const diagnosticsChannel = require(�[32m'diagnostics_channel'�[37m)
[08:58:51.101]         ╵                                    �[32m~~~~~~~~~~~~~~~~~~~~~�[0m
[08:58:51.101] 
[08:58:51.101]   Cannot use "diagnostics_channel" when deploying to Vercel Edge Functions.
[08:58:51.101] 
[08:58:51.101] 
[08:58:51.101] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "worker_threads"�[0m
[08:58:51.103] 
[08:58:51.103]     node_modules/undici/lib/websocket/events.js:5:32:
[08:58:51.103] �[37m      5 │ const { MessagePort } = require(�[32m'worker_threads'�[37m)
[08:58:51.103]         ╵                                 �[32m~~~~~~~~~~~~~~~~�[0m
[08:58:51.103] 
[08:58:51.103]   Cannot use "worker_threads" when deploying to Vercel Edge Functions.
[08:58:51.103] 
[08:58:51.103] 
[08:58:51.103] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "stream"�[0m
[08:58:51.103] 
[08:58:51.103]     node_modules/undici/lib/websocket/receiver.js:3:29:
[08:58:51.104] �[37m      3 │ const { Writable } = require(�[32m'stream'�[37m)
[08:58:51.104]         ╵                              �[32m~~~~~~~~�[0m
[08:58:51.104] 
[08:58:51.104]   Cannot use "stream" when deploying to Vercel Edge Functions.
[08:58:51.104] 
[08:58:51.104] 
[08:58:51.104] �[31m✘ �[41;31m[�[41;97mERROR�[41;31m]�[0m �[1mCould not resolve "diagnostics_channel"�[0m
[08:58:51.104] 
[08:58:51.104]     node_modules/undici/lib/websocket/receiver.js:4:35:
[08:58:51.104] �[37m      4 │ const diagnosticsChannel = require(�[32m'diagnostics_channel'�[37m)
[08:58:51.104]         ╵                                    �[32m~~~~~~~~~~~~~~~~~~~~~�[0m
[08:58:51.104] 
[08:58:51.105]   Cannot use "diagnostics_channel" when deploying to Vercel Edge Functions.
[08:58:51.105] 
[08:58:51.105] 
[08:58:51.109] �[31merror during build:
[08:58:51.109] Error: Bundling with esbuild failed with 45 errors
[08:58:51.109]     at generate_edge_function (file:///vercel/path0/node_modules/@sveltejs/adapter-vercel/index.js:191:12)
[08:58:51.109]     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[08:58:51.109]     at async adapt (file:///vercel/path0/node_modules/@sveltejs/adapter-vercel/index.js:324:5)
[08:58:51.109]     at async adapt (file:///vercel/path0/node_modules/@sveltejs/kit/src/core/adapt/index.js:38:2)
[08:58:51.109]     at async finalise (file:///vercel/path0/node_modules/@sveltejs/kit/src/exports/vite/index.js:1040:7)
[08:58:51.109]     at async Object.handler (file:///vercel/path0/node_modules/@sveltejs/kit/src/exports/vite/index.js:1070:5)
[08:58:51.109]     at async PluginDriver.hookParallel (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:21900:17)
[08:58:51.109]     at async Object.close (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:22901:13)
[08:58:51.110]     at async buildEnvironment (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-DDxXL6bt.js:51496:17)
[08:58:51.110]     at async Object.defaultBuildApp [as buildApp] (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-DDxXL6bt.js:51936:5)�[39m
[08:58:51.177] Error: Command "npm run build" exited with 1
[08:58:51.432] 

If you remove { runtime: 'edge' } from the svelte.config.js then it works without any problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions