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: No Flutter represented type found for type null. #13

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

Exception: No Flutter represented type found for type null. #13

Kahoulam opened this issue Nov 28, 2023 · 0 comments

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:

Exception: No Flutter represented type found for type null.

Version

design_tokens_builder: ^0.2.0+1

Code sample

tokens.json
{
  "global": {
    "M3": {
      "ref": {
        "primary": {
          "primary0": {
            "value": "#000000",
            "type": "color"
          },
          "primary10": {
            "value": "#1d1d00",
            "type": "color"
          },
          "primary20": {
            "value": "#323200",
            "type": "color"
          },
          "primary30": {
            "value": "#494900",
            "type": "color"
          },
          "primary40": {
            "value": "#626200",
            "type": "color"
          },
          "primary50": {
            "value": "#7b7b00",
            "type": "color"
          },
          "primary60": {
            "value": "#969600",
            "type": "color"
          },
          "primary70": {
            "value": "#b1b100",
            "type": "color"
          },
          "primary80": {
            "value": "#cdcd00",
            "type": "color"
          },
          "primary90": {
            "value": "#eaea00",
            "type": "color"
          },
          "primary95": {
            "value": "#f9f900",
            "type": "color"
          },
          "primary99": {
            "value": "#fffbff",
            "type": "color"
          },
          "primary100": {
            "value": "#ffffff",
            "type": "color"
          },
          "primary4": {
            "value": "#0f0f00",
            "type": "color"
          },
          "primary5": {
            "value": "#121200",
            "type": "color"
          },
          "primary6": {
            "value": "#141400",
            "type": "color"
          },
          "primary12": {
            "value": "#212100",
            "type": "color"
          },
          "primary17": {
            "value": "#2c2c00",
            "type": "color"
          },
          "primary22": {
            "value": "#373700",
            "type": "color"
          },
          "primary24": {
            "value": "#3b3b00",
            "type": "color"
          },
          "primary25": {
            "value": "#3e3e00",
            "type": "color"
          },
          "primary35": {
            "value": "#555500",
            "type": "color"
          },
          "primary87": {
            "value": "#e1e100",
            "type": "color"
          },
          "primary92": {
            "value": "#f0f000",
            "type": "color"
          },
          "primary94": {
            "value": "#f6f600",
            "type": "color"
          },
          "primary96": {
            "value": "#fcfc00",
            "type": "color"
          },
          "primary98": {
            "value": "#fffeac",
            "type": "color"
          }
        },
        "secondary": {
          "secondary0": {
            "value": "#000000",
            "type": "color"
          },
          "secondary10": {
            "value": "#1d1d06",
            "type": "color"
          },
          "secondary20": {
            "value": "#323218",
            "type": "color"
          },
          "secondary30": {
            "value": "#49482d",
            "type": "color"
          },
          "secondary40": {
            "value": "#606043",
            "type": "color"
          },
          "secondary50": {
            "value": "#7a795a",
            "type": "color"
          },
          "secondary60": {
            "value": "#949272",
            "type": "color"
          },
          "secondary70": {
            "value": "#aead8b",
            "type": "color"
          },
          "secondary80": {
            "value": "#cac8a5",
            "type": "color"
          },
          "secondary90": {
            "value": "#e7e4bf",
            "type": "color"
          },
          "secondary95": {
            "value": "#f5f3cd",
            "type": "color"
          },
          "secondary99": {
            "value": "#fffbff",
            "type": "color"
          },
          "secondary100": {
            "value": "#ffffff",
            "type": "color"
          },
          "secondary4": {
            "value": "#0f0f00",
            "type": "color"
          },
          "secondary5": {
            "value": "#121201",
            "type": "color"
          },
          "secondary6": {
            "value": "#141402",
            "type": "color"
          },
          "secondary12": {
            "value": "#212109",
            "type": "color"
          },
          "secondary17": {
            "value": "#2b2b12",
            "type": "color"
          },
          "secondary22": {
            "value": "#36361c",
            "type": "color"
          },
          "secondary24": {
            "value": "#3b3a20",
            "type": "color"
          },
          "secondary25": {
            "value": "#3d3d22",
            "type": "color"
          },
          "secondary35": {
            "value": "#545438",
            "type": "color"
          },
          "secondary87": {
            "value": "#dedcb7",
            "type": "color"
          },
          "secondary92": {
            "value": "#eceac5",
            "type": "color"
          },
          "secondary94": {
            "value": "#f2f0ca",
            "type": "color"
          },
          "secondary96": {
            "value": "#f8f5cf",
            "type": "color"
          },
          "secondary98": {
            "value": "#fefbd5",
            "type": "color"
          }
        },
        "tertiary": {
          "tertiary0": {
            "value": "#000000",
            "type": "color"
          },
          "tertiary10": {
            "value": "#002117",
            "type": "color"
          },
          "tertiary20": {
            "value": "#0b372a",
            "type": "color"
          },
          "tertiary30": {
            "value": "#254e40",
            "type": "color"
          },
          "tertiary40": {
            "value": "#3d6657",
            "type": "color"
          },
          "tertiary50": {
            "value": "#567f6f",
            "type": "color"
          },
          "tertiary60": {
            "value": "#6f9a88",
            "type": "color"
          },
          "tertiary70": {
            "value": "#89b4a2",
            "type": "color"
          },
          "tertiary80": {
            "value": "#a4d0bd",
            "type": "color"
          },
          "tertiary90": {
            "value": "#bfecd8",
            "type": "color"
          },
          "tertiary95": {
            "value": "#cdfbe6",
            "type": "color"
          },
          "tertiary99": {
            "value": "#f4fff8",
            "type": "color"
          },
          "tertiary100": {
            "value": "#ffffff",
            "type": "color"
          },
          "tertiary4": {
            "value": "#00120b",
            "type": "color"
          },
          "tertiary5": {
            "value": "#00150d",
            "type": "color"
          },
          "tertiary6": {
            "value": "#00170f",
            "type": "color"
          },
          "tertiary12": {
            "value": "#00251a",
            "type": "color"
          },
          "tertiary17": {
            "value": "#033124",
            "type": "color"
          },
          "tertiary22": {
            "value": "#113c2e",
            "type": "color"
          },
          "tertiary24": {
            "value": "#164032",
            "type": "color"
          },
          "tertiary25": {
            "value": "#194334",
            "type": "color"
          },
          "tertiary35": {
            "value": "#315a4b",
            "type": "color"
          },
          "tertiary87": {
            "value": "#b7e4d0",
            "type": "color"
          },
          "tertiary92": {
            "value": "#c5f2de",
            "type": "color"
          },
          "tertiary94": {
            "value": "#cbf8e3",
            "type": "color"
          },
          "tertiary96": {
            "value": "#d0fee9",
            "type": "color"
          },
          "tertiary98": {
            "value": "#e7fff2",
            "type": "color"
          }
        }
      }
    }
  },
  "$themes": [],
  "$metadata": {
    "tokenSetOrder": [
      "global"
    ]
  }
}

Logs

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

Exception: No Flutter represented type found for type null.
[INFO] Running build completed, took 47ms
[INFO] Caching finalized dependency graph completed, took 43ms
[SEVERE] Failed after 97ms

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.0, 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.2)
[✓] Connected device (1 available)
[✓] Network resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant