phildorado
Change mix run command to task for Debugging
Elixir noob here and apologies in advance if this has already been answered/is really stupid.
Trying to debug open source project strobe audio. https://github.com/strobe-audio:
mix run -e “Peel.scan()” from the command line works.
I’m trying to move this into a mix task so I can use the debugger in VS Code. I can call this function from the task, but it appears the application is not running as I get an error “Peel.Repo is not started, please ensure it is part of your supervision tree”. How can I build the application the same way that mix run does, but from a task? Thanks in advance.
Most Liked
easco
Look in the documentation here:
In the section about Aliases. You should be able to create an alias for your mix run command, I believe.
JakeBecker
run is already a Mix task. Try setting your debug config to something like this:
{
"type": "mix_task",
"name": "Peel.scan/0",
"request": "launch",
"task": "run",
"taskArgs": ["-e", "Peel.scan()"],
"projectDir": "${workspaceRoot}"
}
Last Post!
phildorado
Thanks so much. This is working, however there is something else in ecto.migrate that is causing an exception in the debugger, but not from the terminal. But at least I can start the debugger now.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









