Dune "Unknown constructor include_subdirs" error

I’m encountering an “Unknown constructor include_subdirs” error in my dune project.

Unknown constructor include_subdirs · Issue #1145 · ocaml/dune · GitHub is about the same issue, and is diagnosed there as an old dune version issue (include_subdirs was introduced in 1.1.0 only).

In my case however there must be a different reason, as my dune version is 3.5.0.
My project is viewable at GitHub - jonathandoyle58/toy_dune_project.

include_subdirs is a stanza by itself and not a field of the library stanza.

You should lift it out and put it in the toplevel of the dune file instead.