turbo icon indicating copy to clipboard operation
turbo copied to clipboard

WARNING no output files found for task @repo/ui#lint. Please check your `outputs` key in `turbo.json

Open jahands opened this issue 1 year ago • 4 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/jahands/turborepo-warning-example

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

turbo 2.1.4-canary.9

Describe the Bug

Tasks with no outputs generate a warning like this:

 WARNING  no output files found for task @repo/ui#lint. Please check your `outputs` key in `turbo.json`
 WARNING  no output files found for task docs#lint. Please check your `outputs` key in `turbo.json`
 WARNING  no output files found for task web#lint. Please check your `outputs` key in `turbo.json`

I find this rather annoying

Expected Behavior

Not to print logs complaining of no outputs for tasks that have no outputs defined

To Reproduce

I repro'd this using create-turbo:

pnpm dlx create-turbo@latest
cd ./turborepo-warning-example
pnpm turbo lint

Results in the following logs:

 WARNING  no output files found for task @repo/ui#lint. Please check your `outputs` key in `turbo.json`
 WARNING  no output files found for task docs#lint. Please check your `outputs` key in `turbo.json`
 WARNING  no output files found for task web#lint. Please check your `outputs` key in `turbo.json`

To repro using my repo:

git clone https://github.com/jahands/turborepo-warning-example.git
cd ./turborepo-warning-example
pnpm install
pnpm turbo lint

Additional context

Tested in both canary and 2.2.0 This behavior was introduced in #9236 which looks like it's only supposed to warn when you have outputs defined, not for every task regardless of whether it has outputs defined

jahands avatar Oct 19 '24 11:10 jahands

On my main monorepo, this is adding >200 warnings to my logs for tasks with no outputs defined :( CleanShot 2024-10-19 at 06 07 19@2x

jahands avatar Oct 19 '24 11:10 jahands

@jahands thanks for the report, we'll take a look asap

tknickman avatar Oct 19 '24 15:10 tknickman

I get this warning too

turbo 2.2.1

hckhanh avatar Oct 20 '24 06:10 hckhanh

Just encountered the same issue

kedom1337 avatar Oct 20 '24 18:10 kedom1337

Can someone point out in the docs how I can disable all warnings?

psychobolt avatar Oct 20 '24 23:10 psychobolt

Can someone point out in the docs how I can disable all warnings?

You can use empty ouputs to disable the warning:

{
  outputs: []
}

hckhanh avatar Oct 21 '24 03:10 hckhanh

Can someone point out in the docs how I can disable all warnings?

You can use empty ouputs to disable the warning:

{
  outputs: []
}

Doesn't work to me

smoglica avatar Oct 21 '24 05:10 smoglica

Can someone point out in the docs how I can disable all warnings?

You can use empty ouputs to disable the warning:

{
  outputs: []
}

Well I was looking for a general option to suppress all turbo warnings, not only from a specific task.

Screenshot 2024-10-21 at 7 47 27 AM

psychobolt avatar Oct 21 '24 14:10 psychobolt

I've found out in my case, I can suppress all warnings, including the main issue here. It's in the environment variable docs: https://github.com/vercel/turborepo/blob/bf8fa90dbb69a292ff7bb47f0836258ce9530e29/docs/repo-docs/reference/system-environment-variables.mdx#L21

e.g. TURBO_GLOBAL_WARNING_DISABLED=1 yarn turbo run lint

psychobolt avatar Oct 21 '24 15:10 psychobolt

@psychobolt that setting will disable the warning when global turbo cannot find a locally installed version of turbo to use - it will not globally disable all warnings.

This issue should now be fixed in latest!

tknickman avatar Oct 21 '24 19:10 tknickman

I'm getting this warning with Turbo 2.2.3, Node 18.18.2, MacOS Sequoia (ARM).

In my case the build.outputs array has a single entry outside of the project root.

theandychase avatar Oct 22 '24 15:10 theandychase

Disappeared for me in v2.3.3

"lint": {},

maksnester avatar Dec 16 '24 16:12 maksnester

Is there a way to mark a task's output as optional somehow?

I have a monorepo in which some workspaces output coverage reports and some don't, so I have the following task definition in a global turbo.json:

    "test": {
      "dependsOn": ["^build"],
      "outputs": ["coverage/**"],
      "inputs": ["src/**"],
    },

Now when I run this, I get this warning for the projects that don't output any coverage reports, but I'm fine with that. Is there a way to mark the expected coverage/ output optional?

nvie avatar Dec 19 '24 10:12 nvie

I had same issue but for me was simple, had wrong folder name, my one is dist not .dist "outputs": [".dist/"] -> "outputs": ["dist/"]

This removed that warning for me, FYI, just in case :)

Binomi0 avatar Mar 25 '25 17:03 Binomi0

I concur that we need a optional flag for outputs. Sometimes there are parts of the task we want to run but don't output results.

psychobolt avatar Aug 12 '25 22:08 psychobolt