deploy in vercel
I'm trying to deploy this in vercel, it was success but getting this page , any solution?
I set the output to build, or this app is not possible to deploy in vercel?
Maybe you need to switch to adapter-vercel: https://kit.svelte.dev/docs/adapter-vercel ?
Currently we use adapter-node
This is correct. I've successfully deployed to Vercel with this adapter. I use adapter-node and deploying using Capitano, which is a tool I have been building and will be released soon and deploys apps to Docker Swarm. Also tested deployment via CapRover, successfully.
Here is how I did (I hope it is useful):
import adapter from "@sveltejs/adapter-vercel";
import { vitePreprocess } from "@sveltejs/kit/vite";
import dotenv from "dotenv";
import pkg from "./package.json" assert { type: "json" };
dotenv.config({ path: "./.env.local" });
dotenv.config({ path: "./.env" });
process.env.PUBLIC_VERSION = pkg.version.replace(/\.0\b/g, "");
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
// see the 'Deployment configuration' section below
}),
paths: {
base: process.env.APP_BASE || "",
},
},
};
export default config;
thanks I will try this, also what will be the output? will be build folder?
@fredguth im getting this
what could be the problem?
have you created a mongodb cluster in atlas? you need a the mongo uri in .env.local
Another point... you have to add your environment variables to the project in Vercel's dashboard (I guess there is a way via CLI).
I think this issue can be closed.
@fredguth closing this indeed.
@dominicdev feel free to reach out if you still need help with this and I will reopen it
@fredguth im getting this what could be the problem?
Have the same issue.
- I have used the vercel adapter in svelte.config.js
- added all .env variables In Vercel
- have a mongodb cloud instance
MONGODB_URL=mongodb+srv://xxx:[email protected]/?retryWrites=true&w=majority
The app runs locally with no problems. I wonder if it's the initial startup time that takes a few seconds?
This might lead to a timeout of the serverless functions on the free Vercel tier. I notice that even locally the start is not instant but there is some delay. Could this be the issue?
Note that the only change from the default app is the models part in the .env, using a custom endpoint.
MODELS=`[
{
"name": "TheBloke/OpenOrca-Preview1-13B-GPTQ",
"description": "A good alternative to ChatGPT",
"userMessageToken": "<|### Instruction|>",
"assistantMessageToken": "<|### Response|>",
"messageEndToken": "</s>",
"preprompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n-----\n",
"parameters": {
"temperature": 0.7,
"top_p": 0.95,
"repetition_penalty": 1.2,
"top_k": 50,
"truncate": 1000,
"max_new_tokens": 1024
},
"endpoints": [{"url": "endpointURL"}]
}
]`
This might lead to a timeout of the serverless functions on the free Vercel tier. I notice that even locally the start is not instant but there is some delay. Could this be the issue?
In vercel the app does not work at all? I have seen problems with an inference endpoint that was too slow for vercel, but normally this would happen while trying to use the app (messaging).
If the error is before anything... I would double check if you have all the needed KEYS in the environment.
This might lead to a timeout of the serverless functions on the free Vercel tier. I notice that even locally the start is not instant but there is some delay. Could this be the issue?
In vercel the app does not work at all? I have seen problems with an inference endpoint that was too slow for vercel, but normally this would happen while trying to use the app (messaging).
If the error is before anything... I would double check if you have all the needed KEYS in the environment.
So it deploys without errors, however then I get the timeout screen from above. Vercel allows copy&pasting the whole env file that I have defined locally and extracts these. The error messages are not very helpful on the Vercel side to debug the issue. My best guess is that the initial startup exceeds 10 seconds which is the max timeout limit on the vercel free tier (locally the UI loads in ~4-5 seconds, also not instant)
This is a screen of the env variables being recognized:
Now when I go to the live url it times out
@BEpresent I am having the same issue, did you get this to work?
@BEpresent I am having the same issue, did you get this to work?
Unfortunately not, as mentioned my guess would be that the initial startup time causes a timeout on Vercel serverless. Another provider or a Vercel paid tier might be an alternative but I have not tried this yet.
@BEpresent I am having the same issue, did you get this to work?
Unfortunately not, as mentioned my guess would be that the initial startup time causes a timeout on Vercel serverless. Another provider or a Vercel paid tier might be an alternative but I have not tried this yet.
Oh, I actually fixed it, my MongoDB database didn't include 0.0.0.0/0 in the allowed IP addresses list, so it couldn't be accessed from Vercel. It does suck that the error was not showing at all. Maybe you have the same issue
@BEpresent I am having the same issue, did you get this to work?
Unfortunately not, as mentioned my guess would be that the initial startup time causes a timeout on Vercel serverless. Another provider or a Vercel paid tier might be an alternative but I have not tried this yet.
Oh, I actually fixed it, my MongoDB database didn't include 0.0.0.0/0 in the allowed IP addresses list, so it couldn't be accessed from Vercel. It does suck that the error was not showing at all. Maybe you have the same issue
Interesting thanks, I will try this out. Indeed, it's not apparent from the error messages.
@BEpresent I am having the same issue, did you get this to work?
Unfortunately not, as mentioned my guess would be that the initial startup time causes a timeout on Vercel serverless. Another provider or a Vercel paid tier might be an alternative but I have not tried this yet.
Oh, I actually fixed it, my MongoDB database didn't include 0.0.0.0/0 in the allowed IP addresses list, so it couldn't be accessed from Vercel. It does suck that the error was not showing at all. Maybe you have the same issue
Interesting thanks, I will try this out. Indeed, it's not apparent from the error messages.
Did it work? Also, I noticed that the vercel serverless function times out after 10 seconds, so it couldn't continue streaming the response when using a self-hosted model. I am using the huggingface inference API now.
If anyone finds a solution to this, please post it :) Seems like a massive problem to deploy this anywhere.
yeah i can't deploy to vercel
