Closed woutdp closed 1 year ago
Small update, there's indeed a bug for production, was able to reproduce it
I think it should be fixed. A couple of changes, either follow the reinstallation steps, as they changed a bit, or do the following:
0.4.0
of livesvelte/assets/js/render.js
fileNodeJS
supervisor with:
{NodeJS.Supervisor, [path: Application.app_dir(:my_app, "/priv/static/assets"), pool_size: 4]},
and replace :my_app
with your app name./assets/js/server.js
with the new file
import * as Components from '../svelte/**/*'
import {exportSvelteComponents, render} from 'live_svelte'
module.exports = exportSvelteComponents(Components) module.exports.ssrRenderComponent = render
- Add the following to your `config.exs` file and again replace `:my_app` with your app name:
```elixir
# Configures LiveSvelte
config :live_svelte, :otp_name, :my_app
Hi @woutdp, I've tested it and it appears to be working. Thank you!
@ziazek
Also note, with version 0.4.2
the config.exs configuration can be removed and NodeJS has been simplified to
{NodeJS.Supervisor, [path: LiveSvelte.SSR.server_path(), pool_size: 4]},
@woutdp that's great!
https://elixirforum.com/t/livesvelte-e2e-reactivity-in-liveview-with-svelte/54822/4
Hi @woutdp thanks for creating this project! I’ve used it successfully in a DEV environment, but I can’t figure out how to get SSR to work when I deploy it to fly.io.
I’ve checked that I’ve installed NodeJS on both the builder and runner images, and I’ve tried both 16.x and 18.x versions.
When I remote console into the running application, I get:
It works well when I remove the NodeJS.Supervisor from application.ex.
Any guidance would be much appreciated!