Error: The module Linol.Log is an alias for module Linol__Log, which is missing

Hello,

I’m trying to create a language server using GitHub - c-cube/linol: Wrapper around the OCaml `lsp` library to make it easier to write LSP servers

My dune-project:

(lang dune 3.17)

(name rescript)

(generate_opam_files true)

(package
(name rescript)
(synopsis "ReScript compiler"))

(package
(name analysis)
(synopsis "ReScript Analysis")
(depends
(ocaml
(>= 4.14))
(cppo
(= 1.8.0))
dune
linol
linol-eio
eio_main
logs))

(package
(name tools)
(synopsis "ReScript Tools")
(depends
(ocaml
(>= 4.14))
(cppo
(= 1.8.0))
analysis
dune))

My dune file:

(library
(name analysis)
(flags
(-w "+6+26+27+32+33+39"))
(libraries unix str ext ml jsonlib syntax linol linol-eio eio_main lsp logs reanalyze))

I copied the example code in linol/example/template-eio/main.ml at main · c-cube/linol · GitHub

When I add a log statement like Linol.Log.debug (fun k -> k "req: unhandled request")

Source of Linol.Log: linol/src/log.ml at main · c-cube/linol · GitHub

When I do dune build I get:

File "analysis/src/LSPServer.ml", line 83, characters 8-23:
83 |         Linol.Log.debug (fun k -> k "req: unhandled request");
             ^^^^^^^^^^^^^^^
Error: The module Linol.Log is an alias for module Linol__Log, which is missing

What on earth am I missing here?

Might be worth checking what version you have installed. What does opam list --installed linol show?

Replying to myself - I just installed “linol” and found the log module indeed wasn’t there.

That’s because it is flagged as a private module.

1 Like