chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

💻💻How to deploy to vercel

Open haydenkong opened this issue 1 year ago • 4 comments

Hi,

I am currently having troubles with deploying to Vercel, I am experiencing an error 404 NOT FOUND. I think i am using the wrong build command or the wrong default directory. Can someone please help?

image

Thanksyou!

haydenkong avatar Jun 02 '24 10:06 haydenkong

Could you describe your build steps in a bit more details? I'm not familiar with vercel but maybe someone else can chime in or there's something missing in your deployment

nsarrazin avatar Jun 03 '24 07:06 nsarrazin

Hi,

These are my deployment settings for the vercel. Thanks for helping: image

haydenkong avatar Jun 03 '24 07:06 haydenkong

has anybody tried to deploy repo this lately? I tried a few ways

1. With the node adapter (@sveltejs/adapter-node)

Without the @sveltejs/adapter-vercel and setting the Output directory to build, the index.js is just served as raw text when you navigate the website

image

2. With the vercel adapter (@sveltejs/adapter-vercel)

You get

A Serverless Function has exceeded the unzipped maximum size of 250 MB
image

the fn.func folder (not sure if this is the one that counts) is 193MB

image

2. With the vercel adapter (@sveltejs/adapter-vercel) + split: true option.

I tried setting in the svelte.config.js file this option:

/** @type {import('@sveltejs/kit').Config} */
const config = {
  kit: {
    adapter: adapter({
      split: true,
    }),

This causes the build to fail after 44 mins and 32 mins!

image
Run npm run preview to preview your production build locally.
> Using @sveltejs/adapter-vercel
  Warning: The following modules failed to locate dependencies that may (or may not) be required for your app to work:
  node_modules/mongodb/lib/deps.js
    - kerberos
    - snappy
    - @mongodb-js/zstd
    ...
  node_modules/playwright-core/lib/server/registry/index.js
    - browsers.json
  ✔ done
Build Completed in /vercel/output [11m]
Deploying outputs...
â–² Build system report
â–² To always completely log this report, add VERCEL_BUILD_SYSTEM_REPORT=1 as an Environment Variable to your project.
• At least one "Out of Memory" ("OOM") event was detected during the build.
  • This occurs when processes or applications running during the build completely fill up the available memory (RAM) in the build container. When this happens, the build container terminates one of the processes during the build with a SIGKILL signal.

As the doc says: "If true, causes a route to be deployed as an individual function"

https://svelte.dev/docs/kit/adapter-vercel#Deployment-configuration

Vercel tutorial

This tutorial says that the Vercel adapter is not needed. https://vercel.com/docs/beginner-sveltekit/adapters

But the YouTube video was recorded 2 years ago, so I don't know how relevant is it

gianpaj avatar Nov 07 '24 16:11 gianpaj

is anybody still facing this issue?

geez13 avatar Jan 10 '25 17:01 geez13