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

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

Closed
1 task done
jahands opened this issue Oct 19, 2024 · 13 comments · Fixed by #9301
Closed
1 task done
Assignees
Labels
kind: bug Something isn't working

Comments

@jahands
Copy link

jahands commented Oct 19, 2024

Verify canary release

  • 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 jahands added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Oct 19, 2024
@jahands
Copy link
Author

jahands commented Oct 19, 2024

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

@tknickman
Copy link
Member

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

@hckhanh
Copy link

hckhanh commented Oct 20, 2024

I get this warning too

turbo 2.2.1

@kedom1337
Copy link

Just encountered the same issue

@psychobolt
Copy link

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

@hckhanh
Copy link

hckhanh commented Oct 21, 2024

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

You can use empty ouputs to disable the warning:

{
  outputs: []
}

@smoglica
Copy link

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

@tknickman tknickman removed the needs: triage New issues get this label. Remove it after triage label Oct 21, 2024
@psychobolt
Copy link

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
Copy link

psychobolt commented Oct 21, 2024

I've found out in my case, I can suppress all warnings, including the main issue here. It's in the environment variable docs:

| `TURBO_GLOBAL_WARNING_DISABLED` | Disable warning when global `turbo` cannot find a local version to use. |

e.g. TURBO_GLOBAL_WARNING_DISABLED=1 yarn turbo run lint

@tknickman
Copy link
Member

@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!

@theandychase
Copy link

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.

@maksnester
Copy link

Disappeared for me in v2.3.3

"lint": {},

@nvie
Copy link

nvie commented Dec 19, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants