vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo/docs
MIT License
26k stars 1.79k forks source link

× invalid turbo json Error: × No "extends" key found if `./` is specified in the pnpm-workspace packages #9017

Open aminya opened 3 weeks ago

aminya commented 3 weeks ago

Verify canary release

Link to code that reproduces this issue

https://github.com/aminya/temp-turbo-pnpm-bug

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

pnpm

What operating system are you using?

Linux

Which canary version will you have in your reproduction?

2.0.14

Describe the Bug

When ./ is specified in the packages list in pnpm-workspace.yaml, turbo gives this error. This is very confusing and doesn't provide any info on what the issue is. From the pnpm perspective, ./ is a valid package, but even if turbo doesn't accept this, it should provide a better error message.

turbo 2.0.14

  × invalid turbo json

Error:   × No "extends" key found
    ╭─[turbo.json:1:1]
  1 │ ╭─▶ {
  2 │ │     "$schema": "https://turbo.build/schema.json",
  3 │ │     "tasks": {
  4 │ │       "build": {
  5 │ │         "dependsOn": [
  6 │ │           "prebuild",
  7 │ │           "^build"
  8 │ │         ],
  9 │ │         "outputs": [
 10 │ │           "output-file.txt",
 11 │ │           "dist/**"
 12 │ │         ]
 13 │ │       },
 14 │ │       "prebuild": {},
 15 │ │       "lint": {},
 16 │ │       "type-check": {}
 17 │ │     }
 18 │ ├─▶ }
    · ╰──── add extends key here
    ╰────

Expected Behavior

Work without issues or provide a better error

To Reproduce

pnpm i
pnpm exec turbo build

Additional context

No response

chris-olszewski commented 3 weeks ago

I'm almost positive this is the same bug as reported in https://github.com/vercel/turborepo/issues/8599

We do want to fix this, but it currently isn't a high priority as the workaround is removing the leading ./ from the workspace globs.