elixir-inspector / ua_inspector

User agent parser library
Apache License 2.0
125 stars 23 forks source link

Can't run UAInspector when using ElixirLS #32

Open njouanin opened 1 year ago

njouanin commented 1 year ago

Hi, I've added UAInspector to my phoeniex project, and I have to problem when running mix phx.server. Now I'd like to debug my code from VSCode with ElixirLS plugin. When may application start I get the output below. I don't know if it's a UAInspector problem or more ElixirLS, but may be you can help...

Started ElixirLS Debugger v0.15.1
ElixirLS Debugger built with elixir "1.15.4" on OTP "25"
Running on elixir "1.15.4 (compiled with Erlang/OTP 25)" on OTP "25"
Protocols are not consolidated
Running with MIX_ENV: dev MIX_TARGET: host

14:41:10.543 [info] Experimental server is disabled.
[notice] Application ua_inspector exited: UAInspector.Application.start(:normal, []) returned an error: shutdown: failed to start child: UAInspector.ClientHints.Supervisor
    ** (EXIT) shutdown: failed to start child: UAInspector.ClientHints.Apps
        ** (EXIT) an exception was raised:
            ** (ErlangError) Erlang error: :if_clause
                (yamerl 0.10.0) yamerl_parser.erl:3817: :yamerl_parser.queue_token_keep_last_pos/3
                (yamerl 0.10.0) yamerl_parser.erl:3580: :yamerl_parser.queue_impl_key2/1
                (yamerl 0.10.0) yamerl_parser.erl:1734: :yamerl_parser.parse_mapping_value/5
                (yamerl 0.10.0) yamerl_parser.erl:441: :yamerl_parser.file2/3
                (yamerl 0.10.0) yamerl_constr.erl:521: :yamerl_constr.file/2
                (ua_inspector 3.3.1) Elixir.UAInspector.Util.YAML.erl:14: UAInspector.Util.YAML.read_file/1
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:40: UAInspector.ClientHints.Apps.read_database/0
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.reload_database/0
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.init/1
[notice] Application hackney exited: :stopped
[notice] Application metrics exited: :stopped
[notice] Application ssl_verify_fun exited: :stopped
[notice] Application parse_trans exited: :stopped
[notice] Application syntax_tools exited: :stopped
[notice] Application certifi exited: :stopped
[notice] Application mimerl exited: :stopped
[notice] Application idna exited: :stopped
[notice] Application unicode_util_compat exited: :stopped
[notice] Application polyjuice_util exited: :stopped
[notice] Application nebulex exited: :stopped
[notice] Application shards exited: :stopped
[notice] Application uniq exited: :stopped
[notice] Application argon2_elixir exited: :stopped
[notice] Application comeonin exited: :stopped
[notice] Application yaml_elixir exited: :stopped
[notice] Application yamerl exited: :stopped
[notice] Application telemetry_poller exited: :stopped
[notice] Application telemetry_metrics exited: :stopped
[notice] Application ecto_sql exited: :stopped
[notice] Application postgrex exited: :stopped
[notice] Application db_connection exited: :stopped
[notice] Application phoenix_ecto exited: :stopped
[notice] Application ecto exited: :stopped
[notice] Application phoenix exited: :stopped
[notice] Application jason exited: :stopped
[notice] Application decimal exited: :stopped
[notice] Application castore exited: :stopped
[notice] Application websock_adapter exited: :stopped
[notice] Application plug_cowboy exited: :stopped
[notice] Application cowboy_telemetry exited: :stopped
[notice] Application cowboy exited: :stopped
[notice] Application ranch exited: :stopped
[notice] Application cowlib exited: :stopped
[notice] Application bandit exited: :stopped
[notice] Application hpax exited: :stopped
[notice] Application thousand_island exited: :stopped
[notice] Application websock exited: :stopped
[notice] Application phoenix_template exited: :stopped
[notice] Application phoenix_pubsub exited: :stopped
[notice] Application plug exited: :stopped
[notice] Application telemetry exited: :stopped
[notice] Application plug_crypto exited: :stopped
[notice] Application mime exited: :stopped
[notice] Application eex exited: :stopped
[notice] Application runtime_tools exited: :stopped
Task failed: an exception was raised:
    ** (Mix.Error) Could not start application ua_inspector: UAInspector.Application.start(:normal, []) returned an error: shutdown: failed to start child: UAInspector.ClientHints.Supervisor
    ** (EXIT) shutdown: failed to start child: UAInspector.ClientHints.Apps
        ** (EXIT) an exception was raised:
            ** (ErlangError) Erlang error: :if_clause
                (yamerl 0.10.0) yamerl_parser.erl:3817: :yamerl_parser.queue_token_keep_last_pos/3
                (yamerl 0.10.0) yamerl_parser.erl:3580: :yamerl_parser.queue_impl_key2/1
                (yamerl 0.10.0) yamerl_parser.erl:1734: :yamerl_parser.parse_mapping_value/5
                (yamerl 0.10.0) yamerl_parser.erl:441: :yamerl_parser.file2/3
                (yamerl 0.10.0) yamerl_constr.erl:521: :yamerl_constr.file/2
                (ua_inspector 3.3.1) Elixir.UAInspector.Util.YAML.erl:14: UAInspector.Util.YAML.read_file/1
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:40: UAInspector.ClientHints.Apps.read_database/0
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.reload_database/0
                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.init/1
        (mix 1.15.4) lib/mix.ex:577: Mix.raise/2
        (mix 1.15.4) lib/mix/tasks/app.start.ex:86: Mix.Tasks.App.Start.start/3
        (mix 1.15.4) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
        (mix 1.15.4) lib/mix/tasks/run.ex:129: Mix.Tasks.Run.run/5
        (mix 1.15.4) lib/mix/tasks/run.ex:85: Mix.Tasks.Run.run/1
        (mix 1.15.4) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
        (elixir_ls_debugger 0.15.1) lib/debugger/server.ex:1093: ElixirLS.Debugger.Server.launch_task/2
[error] Error in process #PID<0.1674.0> with exit value:
{%Mix.Error{
   message: "Could not start application ua_inspector: UAInspector.Application.start(:normal, []) returned an error: shutdown: failed to start child: UAInspector.ClientHints.Supervisor\n    ** (EXIT) shutdown: failed to start child: UAInspector.ClientHints.Apps\n        ** (EXIT) an exception was raised:\n            ** (ErlangError) Erlang error: :if_clause\n                (yamerl 0.10.0) yamerl_parser.erl:3817: :yamerl_parser.queue_token_keep_last_pos/3\n                (yamerl 0.10.0) yamerl_parser.erl:3580: :yamerl_parser.queue_impl_key2/1\n                (yamerl 0.10.0) yamerl_parser.erl:1734: :yamerl_parser.parse_mapping_value/5\n                (yamerl 0.10.0) yamerl_parser.erl:441: :yamerl_parser.file2/3\n                (yamerl 0.10.0) yamerl_constr.erl:521: :yamerl_constr.file/2\n                (ua_inspector 3.3.1) Elixir.UAInspector.Util.YAML.erl:14: UAInspector.Util.YAML.read_file/1\n                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:40: UAInspector.ClientHints.Apps.read_database/0\n                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.reload_database/0\n                (ua_inspector 3.3.1) Elixir.UAInspector.ClientHints.Apps.erl:4: UAInspector.ClientHints.Apps.init/1",
   mix: 1
 },
 [
   {Mix, :raise, 2, [file: ~c"lib/mix.ex", line: 577]},
   {Mix.Tasks.App.Start, :start, 3,
    [file: ~c"lib/mix/tasks/app.start.ex", line: 86]},
   {Mix.Task, :"-run_task/5-fun-3-", 3, [file: ~c"lib/mix/task.ex", line: 447]},
   {Mix.Tasks.Run, :run, 5, [file: ~c"lib/mix/tasks/run.ex", line: 129]},
   {Mix.Tasks.Run, :run, 1, [file: ~c"lib/mix/tasks/run.ex", line: 85]},
   {Mix.Task, :"-run_task/5-fun-3-", 3, [file: ~c"lib/mix/task.ex", line: 447]},
   {ElixirLS.Debugger.Server, :launch_task, 2,
    [file: ~c"lib/debugger/server.ex", line: 1093]}
 ]}