Why this fires¶
TE140 means a build-time Resource Graph recipe could not be sealed into its
immutable Resource Image. The program never falls back to the current working
directory at runtime: a declared resource is either captured successfully by
the build or the build fails.
Common causes are:
- the path passed to
Resource.dir(...)does not exist or is not a directory; - an explicit
include(...)pattern matched no files; - a path escapes the resource root, contains
.., or is otherwise invalid; - two inputs produce the same logical path;
- a file could not be read while the snapshot was being sealed.
use std::resource::Resource
const public = comptime Resource.dir("./public")
.include("**/*.html")
.seal()
// ^ error[TE140] when ./public is absent or the include matches nothingPaths are resolved relative to the .zolo source file containing the recipe,
not relative to the shell's current directory.
Fix it¶
- Check that the source directory exists next to the declaring source file.
- Check the
includeandexcludepatterns. An explicit include is a build assertion, so matching zero files is intentionally an error. - Keep every logical resource path inside the declared root and use
/as the separator in patterns. - If two trees need to contribute to one public filesystem, compose them with
an explicit conflict policy before calling
seal().
Why this is a build error¶
A sealed ResourceFs is part of the program's content identity. Allowing a
missing directory or unmatched pattern to become an empty runtime filesystem
would produce deployments that compile successfully and then return missing
assets in production. TE140 keeps that failure deterministic and local to the
recipe that caused it.