We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e44b88 commit 3550dd1Copy full SHA for 3550dd1
lib/elixir/lib/code.ex
@@ -1373,8 +1373,17 @@ defmodule Code do
1373
:error ->
1374
case :code.which(module) do
1375
:preloaded ->
1376
- path = Path.join([:code.lib_dir(:erts), "doc", "chunks", "#{module}.chunk"])
1377
- fetch_docs_from_chunk(path)
+ # The erts directory is not necessarily included in releases
+ # unless it is listed as an extra application.
1378
+ case :code.lib_dir(:erts) do
1379
+ path when is_list(path) ->
1380
+ [path, "doc", "chunks", "#{module}.chunk"]
1381
+ |> Path.join()
1382
+ |> fetch_docs_from_chunk()
1383
+
1384
+ {:error, _} ->
1385
+ {:error, :chunk_not_found}
1386
+ end
1387
1388
_ ->
1389
{:error, :module_not_found}
0 commit comments