Skip to content

[Bug]: Improve error message for malformed blueprint JSON #30

Description

@devi5040

Describe the bug

When a blueprint JSON file contains invalid syntax or is malformed, Scaffinity currently surfaces the raw JSON.parse error.

While technically correct, the message isn't very user-friendly and doesn't clearly indicate which blueprint caused the issue or provide guidance for fixing it.

Blueprint or command used

{
  "name": "example",
  "files": [
    {
      "path": "README.md",
      "content": "Hello"
    }
  ] // missing closing brace
scaffinity generate blueprint.json

Expected behavior

Scaffinity should catch JSON parsing errors and display a clearer, more actionable error message.

For example:

  • The blueprint file that failed to parse.
  • The approximate line/column where parsing failed.
  • A suggestion to validate the JSON syntax before retrying.

Actual behavior

The CLI prints the raw JSON.parse error, which may be difficult for beginners to understand.

Environment

  • Scaffinity version: scaffinity -v
  • Node version: node -v
  • OS:
  • Package manager: npm / pnpm / yarn

Additional context

Improving this error message would make the CLI more beginner-friendly and provide a better developer experience when authoring custom blueprints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions