# mod.jq
import "data" as $data;
.
# main.jq
import "mod" as mod;
include "mod";
.
Running jq -n -f main.jq yields:
jq: error: jq: error: library should only have function definitions, not a main expression
<unknown location>
jq-linux-amd64-1.7.1: src/compile.c:383: block_bind_library: Assertion `block_has_only_binders(binder, bindflags)' failed.
Aborted (core dumped)
The same also happens when we write twice import or include.
Suppose that we have two files:
Running
jq -n -f main.jq
yields:The same also happens when we write twice
import
orinclude
.Environment