Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem when deploying in vercel #51

Closed
aris-2 opened this issue Jul 1, 2024 · 4 comments
Closed

problem when deploying in vercel #51

aris-2 opened this issue Jul 1, 2024 · 4 comments
Labels
seen I've seen and read this issue and I'll try find some time soon to work on it.

Comments

@aris-2
Copy link

aris-2 commented Jul 1, 2024

Hi, I am using https://github.com/razshare/sveltekit-sse

and I can't get it to work in vercel,
It works for about 10 seconds and then stops working.

Everything would indicate that the problem is due to the limitations that vercel has by being serverless as indicated in this conversation.

https://stackoverflow.com/questions/76204143/sse-works-locally-but-not-when-deployed-to-vercel

Although it is indicated as a solution to use the edge runtime when making the configurations, the problem persists and only works for 10s,

use this template for edge runtime implementation

https://vercel.com/templates/svelte/sveltekit-edge-functions

but when performing the deployment receipt the following error

You cannot use "streaming" when deploying to Vercel Edge Functions.

@aris-2 aris-2 changed the title problem when deploying in vercel and cloudflare pages problem when deploying in vercel Jul 1, 2024
@razshare razshare added the seen I've seen and read this issue and I'll try find some time soon to work on it. label Jul 1, 2024
@razshare
Copy link
Owner

razshare commented Jul 1, 2024

Hello @aristelecom ,
First of all, thank you for the feedback.

Second, I'm not very familiar with the internals of vercel functions.
However, judging from that message it doesn't seem like something I can fix from this library's side.
The library is not doing anything special in the background, it's only using standard js readable streams to stream events.

That being said, I just tried to deploy an application to vercel using sveltekit-sse and it works fine, it doesn't stop after 10 seconds like in your case.

Here's the repo I deployed to vercel in my test https://github.com/razshare/sveltekit-sse-issue-51, you can try deploying that and see if you're still getting that error.
If the error persists, my hunch is the problem is within your vercel dashboard or something like that.

I'm willing to give it a try and take a look at the issue in more depth, but I need you to create a repository that reproduces the error as you see it, otherwise I can't help you.

@aris-2
Copy link
Author

aris-2 commented Jul 1, 2024

Hello @aristelecom , First of all, thank you for the feedback.

Second, I'm not very familiar with the internals of vercel functions. However, judging from that message it doesn't seem like something I can fix from this library's side. The library is not doing anything special in the background, it's only using standard js readable streams to stream events.

That being said, I just tried to deploy an application to vercel using sveltekit-sse and it works fine, it doesn't stop after 10 seconds like in your case.

Here's the repo I deployed to vercel in my test https://github.com/razshare/sveltekit-sse-issue-51, you can try deploying that and see if you're still getting that error. If the error persists, my hunch is the problem is within your vercel dashboard or something like that.

I'm willing to give it a try and take a look at the issue in more depth, but I need you to create a repository that reproduces the error as you see it, otherwise I can't help you.

Hello, thanks for responding, it seems the problem I am experiencing is due to a limitation of your platform and not a problem with the library as you indicated above,

make the same query in the svelte discord attached the link: https://discord.com/channels/457912077277855764/1257434497268449340

According to the comments, it is not possible to solve the problem given the limitations of vercel, so I think I will have to use another service,

I'll try cloudfalre pages although I suspect I'm going to face the same problem.

An alternative solution might be to continue hosting my page on vercel and host the ss e function on some service like render.

also and entered link: https://sveltekit-sse-issue-51.vercel.app/ of the repo you attached and it presents this error

image

@razshare
Copy link
Owner

razshare commented Jul 1, 2024

also and entered link: https://sveltekit-sse-issue-51.vercel.app/ of the repo you attached and it presents this error

I should've clarified, that link is no longer available.
I deployed the app, did some tests and then destroyed the vercel app.
If you want to test it yourself you need to take that code and deploy it yourself.

The link is just added automatically by vercel I think, I forgot to remove it.

According to the comments, it is not possible to solve the problem given the limitations of vercel, so I think I will have to use another service,

If it's any help, other people have deployed it with success to cloudflare.

@razshare
Copy link
Owner

razshare commented Jul 1, 2024

Also, I've recently added this section to the readme, you might find it interesting, the second point at least https://github.com/razshare/sveltekit-sse?tab=readme-ov-file#faq

@aris-2 aris-2 closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
seen I've seen and read this issue and I'll try find some time soon to work on it.
Projects
None yet
Development

No branches or pull requests

2 participants