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

cmd/cue: help embed documentation says nothing about module-containment requirement #3788

Open
myitcv opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@myitcv
Copy link
Member

myitcv commented Feb 27, 2025

What page were you looking at?

https://cuelang.org/docs/reference/command/cue-help-embed/

What version of the site were you looking at?

cue version v0.13.0-0.dev.0.20250227123918-a0c6dfeb4553

go version go1.24.0
      -buildmode exe
       -compiler gc
  DefaultGODEBUG gotestjsonbuildtext=1,multipathtcp=0,randseednop=0,rsa1024min=0,tlsmlkem=0,x509rsacrt=0,x509usepolicies=0
     CGO_ENABLED 1
          GOARCH arm64
            GOOS linux
         GOARM64 v8.0
             vcs git
    vcs.revision a0c6dfeb45535f87f9dae70d8b9cec9e8f10e67e
        vcs.time 2025-02-27T12:39:18Z
    vcs.modified false
cue.lang.version v0.13.0

cue-lang/cuelang.org@460d21b

What did you do?

Read the above page and tried to run:

exec cue export .

-- a.json --
{
    "aField": "a value"
}
-- x.cue --
@extern(embed)

package p

manyFiles: _ @embed(glob=*.json)

What did you expect?

The test to pass.

What did you see instead?

> exec cue export .
[stderr]
cannot embed files when not in a module
[exit status 1]
FAIL: /tmp/testscript1354656307/repro.txtar/script.txtar:1: unexpected command failure

The help text for embed should call out that, by design, embed files can only be loaded from within a CUE module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant