Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including and importing module with importing JSON crashes jq #3126

Open
01mf02 opened this issue May 24, 2024 · 0 comments
Open

Including and importing module with importing JSON crashes jq #3126

01mf02 opened this issue May 24, 2024 · 0 comments

Comments

@01mf02
Copy link

01mf02 commented May 24, 2024

Suppose that we have two files:

# 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.

Environment

  • OS and Version: Ubuntu 22.04
  • jq version 1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant