Skip to content

Commit

Permalink
properly encode server components
Browse files Browse the repository at this point in the history
  • Loading branch information
drKreso authored and woutdp committed Jan 11, 2024
1 parent 28cd599 commit e51cc18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ssr/node_js.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ defmodule LiveSvelte.SSR.NodeJS do

def render(name, props, slots) do
try do
NodeJS.call!({"server", "render"}, [name, props, slots])
NodeJS.call!({"server", "render"}, [name, props, slots], binary: true)
catch
:exit, {:noproc, _} ->
message = """
NodeJS is not configured. Please add the following to your application.ex:
{NodeJS.Supervisor, [path: LiveSvelte.SSR.NodeJS.server_path(), pool_size: 4]},
"""

raise %LiveSvelte.SSR.NotConfigured{message: message}
end
end
Expand All @@ -19,4 +20,4 @@ defmodule LiveSvelte.SSR.NodeJS do
{:ok, path} = :application.get_application()
Application.app_dir(path, "/priv/svelte")
end
end
end

0 comments on commit e51cc18

Please sign in to comment.