#3145·jq

modulemeta failure when module location is found by "search"

Author: pkoppsteinCreated Jun 28, 2024Updated Sep 11, 2026

When a jq module location is specified by a "search" key, modulemeta can fail even when the module is successfully located.

To Reproduce

$ mkdir obscure

$ cat << EOF > obscure/amod.jq
module {"name": "amod", "foo": "bar"};
def a: "a";
EOF

# First verify our setup is valid:
$ jq -n -Lobscure 'import "amod" as amod; "amod" | modulemeta'
{
  "name": "amod",
  "foo": "bar",
  "deps": [],
  "defs": [
    "a/0"
  ]
}
# Now illustrate the problem:
$ jq -n 'import "amod" as amod {search: "obscure"}; "amod" | modulemeta'
jq: error (at <unknown>): module not found: amod

Context jq-1.7.1 and other versions as well