diff --git a/lib/ssr/node_js.ex b/lib/ssr/node_js.ex index 6c0bc6a..2de22f9 100644 --- a/lib/ssr/node_js.ex +++ b/lib/ssr/node_js.ex @@ -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 @@ -19,4 +20,4 @@ defmodule LiveSvelte.SSR.NodeJS do {:ok, path} = :application.get_application() Application.app_dir(path, "/priv/svelte") end -end \ No newline at end of file +end