这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@chris-olszewski
Copy link
Contributor

Description

Fixes #10499

Testing Instructions

[0 olszewski@macbookpro] /tmp/trailing $ turbo build
turbo 2.5.4-canary.0

turbo_json_parse_error

  × Failed to parse turbo.json.
  ╰─▶   × Expected a property but instead found '}'.
          ╭─[turbo.json:9:5]
        8 │       "outputs": [".next/**", "!.next/cache/**"],
        9 │     },
          ·     ─
       10 │     "lint": {
          ╰────

[1 olszewski@macbookpro] /tmp/trailing $ turbo_dev --skip-infer build
turbo 2.5.4

• Packages in scope: @repo/eslint-config, @repo/typescript-config, @repo/ui, docs, web
• Running build in 5 packages
• Remote caching disabled

@chris-olszewski chris-olszewski requested a review from a team as a code owner June 2, 2025 17:30
@chris-olszewski chris-olszewski requested a review from tknickman June 2, 2025 17:30
@vercel
Copy link
Contributor

vercel bot commented Jun 2, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 2, 2025 6:11pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
turbo-site ⬜️ Skipped (Inspect) Jun 2, 2025 6:11pm

@@ -1,5 +1,5 @@
{
"$schema": "https://turborepo.com/schema.json",,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whatever reason, double , with trailing commas really creates a wild output that isn't useful when snapshot. The error could be better, but ITG as the first error still highlights the double ,,

turbo_json_parse_error                                                                                                                                                        
                                                                                                                                                                              
  × Failed to parse turbo.json.                                                                                                                                               
  ├─▶   × expected `}` but instead found `,`                                                                                                                                  
  │      ╭─[turbo.json:2:50]                                                                                                                                                  
  │    1 │ {                                                                                                                                                                  
  │    2 │   "$schema": "https://turborepo.com/schema.json",,                                                                                                                 
  │      ·                                                  ─                                                                                                                 
  │    3 │   "ui": "tui",                                                                                                                                                     
  │      ╰────                                                                                                                                                                
  ├─▶   × End of file expected                                                                                                                                                
  │      ╭─[turbo.json:3:3]                                                                                                                                                   
  │    2 │   "$schema": "https://turborepo.com/schema.json",,                                                                                                                 
  │    3 │   "ui": "tui",                                                                                                                                                     
  │      ·   ────                                                                                                                                                             
  │    4 │   "tasks": {                                                                                                                                                       
  │      ╰────                                                                                                                                                                
  ├─▶   × End of file expected                                                                                                                                                
  │      ╭─[turbo.json:3:7]
  │    2 │   "$schema": "https://turborepo.com/schema.json",,
  │    3 │   "ui": "tui",
  │      ·       ─
  │    4 │   "tasks": {
  │      ╰────
  ├─▶   × End of file expected
  │      ╭─[turbo.json:3:9]
  │    2 │   "$schema": "https://turborepo.com/schema.json",,
  │    3 │   "ui": "tui",
  │      ·         ─────
  │    4 │   "tasks": {
  │      ╰────
  ├─▶   × End of file expected
  │      ╭─[turbo.json:3:14]
  │    2 │   "$schema": "https://turborepo.com/schema.json",,
  │    3 │   "ui": "tui",
  │      ·              ─
  │    4 │   "tasks": {
  │      ╰────
  ├─▶   × End of file expected
  │      ╭─[turbo.json:4:3]
  │    3 │   "ui": "tui",
  │    4 │   "tasks": {
  │      ·   ───────
  │    5 │     "build": {
  │      ╰────
  ├─▶   × End of file expected
  │      ╭─[turbo.json:4:10]
  │    3 │   "ui": "tui",
  │    4 │   "tasks": {
  │      ·          ─
  │    5 │     "build": {
  │      ╰────
  ├─▶   × End of file expected
  │       ╭─[turbo.json:4:12]
  │     3 │       "ui": "tui",
  │     4 │ ╭─▶   "tasks": {
  │     5 │ │       "build": {
  │     6 │ │         "dependsOn": ["^build"],
  │     7 │ │         "inputs": ["$TURBO_DEFAULT$", ".env*"],
  │     8 │ │         "outputs": [".next/**", "!.next/cache/**"],
  │     9 │ │       },
  │    10 │ │       "lint": {
  │    11 │ │         "dependsOn": ["^lint"]
  │    12 │ │       },
  │    13 │ │       "check-types": {
  │    14 │ │         "dependsOn": ["^check-types"]
  │    15 │ │       },
  │    16 │ │       "dev": {
  │    17 │ │         "cache": false,
  │    18 │ │         "persistent": true
  │    19 │ │       }
  │    20 │ ╰─▶   }
  │    21 │     }
  │       ╰────
  ├─▶   × End of file expected
  │       ╭─[turbo.json:21:1]
  │    20 │   }
  │    21 │ }
  │       · ─
  │       ╰────
  ╰─▶   × turbo.json has an incorrect type, expected an object, but received an array.

@chris-olszewski chris-olszewski merged commit ad9c6c3 into main Jun 2, 2025
40 checks passed
@chris-olszewski chris-olszewski deleted the chrisolszewski/turbo-4729-turbojsonc-does-not-play-well-with-prettier branch June 2, 2025 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

turbo.jsonc does not play well with prettier

3 participants