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

FormatException: Invalid double Regular #9

Open
Kahoulam opened this issue Nov 26, 2023 · 0 comments
Open

FormatException: Invalid double Regular #9

Kahoulam opened this issue Nov 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Kahoulam
Copy link

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:

FormatException: Invalid double Regular

Version

design_tokens_builder: ^0.2.0+1

Code sample

tokens.json
{
  "global": {
    "fontWeights": {
      "roboto-0": {
        "value": "Regular",
        "type": "fontWeights"
      },
      "roboto-1": {
        "value": "Medium",
        "type": "fontWeights"
      },
      "roboto-2": {
        "value": "SemiBold",
        "type": "fontWeights"
      }
    }
  },
  "$themes": [],
  "$metadata": {
    "tokenSetOrder": [
      "global"
    ]
  }
}

Logs

Console logs
[INFO] Generating build script completed, took 232ms
[INFO] Reading cached asset graph completed, took 64ms
[INFO] Checking for updates since last build completed, took 846ms
[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 41ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 600ms
[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 901ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[SEVERE] design_tokens_builder on lib/$lib$:

FormatException: Invalid double
Regular
[INFO] Running build completed, took 36ms
[INFO] Caching finalized dependency graph completed, took 41ms
[SEVERE] Failed after 83ms

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
@Sese-Schneider Sese-Schneider added the bug Something isn't working label Nov 26, 2023
Kahoulam added a commit to howflutter/design_tokens_builder that referenced this issue Nov 26, 2023
New FigmaFontWeight enum with tryParse method

Closes: simpleclub#9
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

No branches or pull requests

2 participants