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

Exception: Unable to parse dimension value with data: 0 #7

Open
Kahoulam opened this issue Nov 25, 2023 · 0 comments · May be fixed by #8
Open

Exception: Unable to parse dimension value with data: 0 #7

Kahoulam opened this issue Nov 25, 2023 · 0 comments · May be fixed by #8
Labels
bug Something isn't working

Comments

@Kahoulam
Copy link

Kahoulam commented Nov 25, 2023

Steps to reproduce

  1. Create a new project
  2. Add tokens.json file
  3. Execute the command dart run build_runner build

Expected results

Correctly generate tokens.dart file

Actual results

An error occurred:

Exception: Unable to parse dimension value with data: 0

Version

design_tokens_builder: ^0.2.0+1

Code sample

tokens.json
{
  "global": {
    "M3": {
      "Elevation Light": {
        "1": {
          "value": [
            {
              "color": "#0000004d",
              "type": "dropShadow",
              "x": 0,
              "y": 1,
              "blur": 2,
              "spread": 0
            },
            {
              "color": "#00000026",
              "type": "dropShadow",
              "x": 0,
              "y": 1,
              "blur": 3,
              "spread": 1
            }
          ],
          "type": "boxShadow"
        },
        "2": {
          "value": [
            {
              "color": "#0000004d",
              "type": "dropShadow",
              "x": 0,
              "y": 1,
              "blur": 2,
              "spread": 0
            },
            {
              "color": "#00000026",
              "type": "dropShadow",
              "x": 0,
              "y": 2,
              "blur": 6,
              "spread": 2
            }
          ],
          "type": "boxShadow"
        },
        "3": {
          "value": [
            {
              "color": "#00000026",
              "type": "dropShadow",
              "x": 0,
              "y": 4,
              "blur": 8,
              "spread": 3
            },
            {
              "color": "#0000004d",
              "type": "dropShadow",
              "x": 0,
              "y": 1,
              "blur": 3,
              "spread": 0
            }
          ],
          "type": "boxShadow"
        },
        "4": {
          "value": [
            {
              "color": "#00000026",
              "type": "dropShadow",
              "x": 0,
              "y": 6,
              "blur": 10,
              "spread": 4
            },
            {
              "color": "#0000004d",
              "type": "dropShadow",
              "x": 0,
              "y": 2,
              "blur": 3,
              "spread": 0
            }
          ],
          "type": "boxShadow"
        },
        "5": {
          "value": [
            {
              "color": "#00000026",
              "type": "dropShadow",
              "x": 0,
              "y": 8,
              "blur": 12,
              "spread": 6
            },
            {
              "color": "#0000004d",
              "type": "dropShadow",
              "x": 0,
              "y": 4,
              "blur": 4,
              "spread": 0
            }
          ],
          "type": "boxShadow"
        }
      }
    }
  },
  "$themes": [],
  "$metadata": {
    "tokenSetOrder": [
      "global"
    ]
  }
}

Logs

Console logs
[INFO] Generating build script completed, took 264ms
[INFO] Reading cached asset graph completed, took 76ms
[INFO] Checking for updates since last build completed, took 910ms
[WARNING] design_tokens_builder|lib/design_tokens_builder.dart was not found in the asset graph, incremental builds will not work.
 This probably means you don't have your dependencies specified fully in your pubspec.yaml.
[WARNING] Invalidating asset graph due to build script update!
[INFO] Cleaning up outputs from previous builds. completed, took 1ms
[INFO] Generating build script completed, took 43ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 625ms
[WARNING] design_tokens_builder|lib/design_tokens_builder.dart was not found in the asset graph, incremental builds will not work.
 This probably means you don't have your dependencies specified fully in your pubspec.yaml.
[INFO] Building new asset graph completed, took 899ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[SEVERE] design_tokens_builder on lib/$lib$:

Exception: Unable to parse dimension value with data: 0
[INFO] Running build completed, took 104ms
[INFO] Caching finalized dependency graph completed, took 40ms
[SEVERE] Failed after 149ms

Flutter Doctor output

Doctor output
  [✓] Flutter (Channel stable, 3.13.9, on macOS 14.0 23A344 darwin-arm64, locale en-TW)
  [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
  [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 2022.3)
  [✓] VS Code (version 1.84.0)
  [✓] Connected device (1 available)
  [✓] Network resources
Kahoulam added a commit to howflutter/design_tokens_builder that referenced this issue Nov 26, 2023
@Kahoulam Kahoulam linked a pull request Nov 26, 2023 that will close this issue
3 tasks
@Sese-Schneider Sese-Schneider added the bug Something isn't working label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants