I’m trying to use FastSanitizer in a Mix Task, with the following code :
defmodule Mix.Tasks.HelloTask do @impl Mix.Task def run(_) do html = """ <p>blah</p> """ IO.puts FastSanitize.basic_html(html) end end
I end up with the following error :
** (exit) exited in: NimblePool.checkout(FastHtml.Pool) ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started (nimble_pool 0.1.0) lib/nimble_pool.ex:261: NimblePool.exit!/3 (fast_html 2.0.4) lib/fast_html.ex:125: :fast_html.find_and_use_port/3 (fast_sanitize 0.2.2) lib/fast_sanitize/fragment.ex:8: FastSanitize.Fragment.to_tree/1 (fast_sanitize 0.2.2) lib/fast_sanitize/sanitizer.ex:30: FastSanitize.Sanitizer.scrub/2 (testelixir 0.1.0) lib/hellotask.ex:10: Mix.Tasks.HelloTask.run/1 (mix 1.11.3) lib/mix/task.ex:394: Mix.Task.run_task/3 (mix 1.11.3) lib/mix/cli.ex:84: Mix.CLI.run_task/2
I tried to “start an application”, as suggested by the error message, but I did not manage to solve the issue that way.
I tried to setup async task, as suggested by some search on the forum, but I did not manage to solve the issue either.
What do I miss ?