A task uses a file that isn't among its inputs
warning: @acme/web#build: read packages/web/.env, which isn't among its inputshint: Add it to the task's inputs in axle.toml, so that changing it runs the task again.warning: @acme/web#build: failed when given only its inputshint: Its output from that run is above. Add the files it needs to the task's inputs in axle.toml.warning: @acme/web#build: wrote a different packages/web/dist/index.js when given only its inputshint: Add the files it's made from to the task's inputs in axle.toml, or make the task write the same file every time.Why it happens
Section titled “Why it happens”With --check-inputs, Axle looks for tasks that use a file that isn’t one of their inputs. Changing such a file doesn’t change the task’s hash, so the cache can give back a result made from an older version of it.
- Read a file: on Linux, Axle followed the files the task opened, and it read this one. Axle leaves out files in
node_modules,.gitand.axle, files outside the repository, files changed while the task ran, and files that the task or a task it waits for declares as inputs or outputs. - Failed when given only its inputs: Axle ran the task again in a copy of the repository holding only what it declares, and it failed there. Its output from that run comes just before, after a line saying it failed and with what exit code; the error in it usually names the file it missed.
- Wrote a different file: the task passed in that copy, but this output differs from the one it wrote in the repository, or only one of the two runs wrote it. Something the task didn’t declare changed what it wrote.
With --check-inputs=error or checkInputs = "error", the task fails as well, with one of these lines in its output:
Axle failed this task: it read files that aren't among its inputsAxle failed this task: it didn't do the same with only its inputsHow to fix it
Section titled “How to fix it”Add the file, or a glob that matches it, to the task’s inputs in axle.toml. If the task reads it only by accident, change the task so it doesn’t.
An output can also differ though the inputs are complete: when the task writes something that changes from run to run, such as the time, or writes the paths of installed packages, as some bundlers do in source maps. Make the output the same each time, for example by leaving the time out, or check that task with tracing on Linux.