JakeBecker/ide-elixir

module ZB.Web is not loaded and could not be found

Closed this issue · 12 comments

Every letter I type is producing this error in the console

    ** (CompileError) /Users/jakebecker/code/js/ide-elixir/elixir-ls/deps/elixir_sense/lib/elixir_sense/core/ast.ex:19: module ZB.Web is not loaded and could not be found
        (elixir) src/elixir_expand.erl:86: :elixir_expand.expand/2
        (elixir) src/elixir_expand.erl:511: :elixir_expand.expand_block/4
        (elixir) src/elixir_expand.erl:39: :elixir_expand.expand/2
        (elixir) src/elixir.erl:272: :elixir.quoted_to_erl/3
        (elixir) src/elixir.erl:230: :elixir.eval_forms/4
        (elixir) lib/code.ex:170: Code.eval_string/3
        (elixir_sense) lib/elixir_sense/core/ast.ex:66: ElixirSense.Core.Ast.add_directive_modules_to_env/3
    at new ResponseError (/Users/Michael/.atom/packages/ide-elixir/node_modules/vscode-jsonrpc/lib/messages.js:46:28)
    at handleResponse (/Users/Michael/.atom/packages/ide-elixir/node_modules/vscode-jsonrpc/lib/main.js:430:48)
    at processMessageQueue (/Users/Michael/.atom/packages/ide-elixir/node_modules/vscode-jsonrpc/lib/main.js:258:17)
    at Immediate.<anonymous> (/Users/Michael/.atom/packages/ide-elixir/node_modules/vscode-jsonrpc/lib/main.js:242:13)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)

Can you tell what kind of request it's in response to? Also, can you confirm the module ZB.Web is available and should be loaded?

Though it seems excessive, these errors are the expected behavior if the client attempts a request such as auto-completion and the current file can't be analyzed. The request handler adheres to the "let it fail" Elixir school of error handling and fails with an error message. In the VS Code plugin, I set the client to not show errors because they're common and typically not fatal.

I was typing a function name trying to test out auto-complete, which doesn't appear to be working. ZB.Web is available and should be loaded on the file.

Although it does appear that go to for that file does not work

Does mix compile from the CLI succeed?

yes

Can you publish your code somewhere for me to look at?

Let me see if I can replicate in a personal project that I can share

In my personal project I'm getting a different error

Uncaught Error: spawn mix ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

'mix' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.

What OS, Erlang, and Elixir version are you running?

Mac High Sierra

MichaelStClair:zipbooks Michael$ elixir -v
Erlang/OTP 20 [erts-9.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.5.1

I think I may have found another piece of the problem. My application contains multiple directories, one with ember for the frontend and another for phoenix as the backend, so mix.exs is not in the root directory. Is there a way to specify it in another location?

I added a config option elixirLS.projectDir in the latest release to set your project folder to a subdirectory. However, I'm not entirely sure how to do this on a per-project basis in Atom.