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

Has anyone managed to get SSR to work consistently? #133

Open
timadevelop opened this issue May 18, 2024 · 5 comments
Open

Has anyone managed to get SSR to work consistently? #133

timadevelop opened this issue May 18, 2024 · 5 comments

Comments

@timadevelop
Copy link

It seems like NodeJS server process leaks leading to a crash and I wonder if it's something on my side.

I could go down the road of debugging these leaks, though I'm not sure it's worth the time considering other folks gave up and disabled SSR.

Are there people who actually use SSR with live_svelte & NodeJS in production?

image

The project is on 0.13.1 vsn.

Thx for your work @woutdp

@acco
Copy link
Contributor

acco commented May 20, 2024

FWIW, we too experienced Node process leaks with SSR enabled. Tried a few different things, including configuring Node to GC more aggressively. Eventually decided it wasn't worth it and disabled SSR.

@Valian
Copy link

Valian commented May 20, 2024

The default implementation of NodeJS package clears import cache on each call.

It kills performance and possibly introduces memory leaks. I'm not exactly sure what's the best way to set NODE_ENV, since worker env is not customisable. Maybe setting env variable for elixir process would be enough, since ENV should be inherited? 🤔

I noticed all these problems when implementing PR with ESM modules support needed for my library LiveVue to function correctly. There's some actions from maintainers, hopefully it will get better soon 🤞

@dmbr0
Copy link

dmbr0 commented Jun 14, 2024

sorry for the dumb question but why can't phoenix/elixir take the place of SSR?

@timadevelop
Copy link
Author

quick reply:

seems like changing NODE_ENV fixes it to some point, but I had no time to perform stress tests. So cannot verify it works yet.

sorry for the dumb question but why can't phoenix/elixir take the place of SSR?

@dmbr0 Phoenix can SSR anything you want but there's a case when you have lots of JS-based components written in Svelte / Vue / React / whatever that are not ported to LiveView / PHX. One can go and "copy" needed components into heex templates but this might become a mess to support. Hence most people need to render JS components on the server for SSR -> Node or Bun dependency is inevitable.

@johninvictus
Copy link

I am hoping this issue is fixed soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants