Skip to main content

Framework Detection

Splat automatically detects your framework based on:
  • Command patterns (npm start, uvicorn, rails server)
  • Project files (package.json, requirements.txt, Cargo.toml)
  • File extensions (.py, .jsx, .go, .rs)
Framework detection enables Splat to provide context-aware fixes and framework-specific debugging.

Python Frameworks

FastAPI

splat squash "uvicorn main:app --reload"
Common FastAPI Errors Splat Fixes:
Before
from pydantic import BaseModel

class User(BaseModel):
    id: int
    name: str

@app.post("/users")
def create_user(user: User):
    return {"id": "not_an_int", "name": user.name}  # Type mismatch
$ splat squash -r "uvicorn main:app --reload"

 Error: Pydantic validation error - expected int for 'id'
 Fix: Ensure return values match the User model types
Before
@app.get("/users/{user_id}")
def get_user(user_id: int):
    user = database.query(user_id)  # database not imported
    return user
$ splat squash -r "uvicorn main:app"

 Error: NameError: name 'database' is not defined
 Analysis: database module imported in dependencies.py but not in main.py
 Fix: Add import statement: from dependencies import database

Django

splat squash "python manage.py runserver"
Django-Specific Examples:
$ splat squash "python manage.py migrate"

 Error: django.db.migrations.exceptions.InconsistentMigrationHistory

 Analysis:
  Migration 0003_user_email already applied but file is missing
  Detected in: migrations/ directory

 Suggested fix:
  Run: python manage.py migrate --fake app_name 0003
  Or: Restore missing migration file from git history
Before: templates/users.html
{% for user in users %}
  <p>{{ user.name }}</p>
<!-- Missing {% endfor %} -->
$ splat squash -r "python manage.py runserver"

 Error: TemplateSyntaxError: Unclosed tag 'for'
 File: templates/users.html:3

 Fix: Add {% endfor %} tag at end of loop

Flask

splat squash "flask run"

JavaScript/TypeScript Frameworks

React

splat squash "npm start"
Common React Errors:
Before
import { useEffect, useState } from 'react';

function UserProfile({ userId }) {
  const [user, setUser] = useState(null);
  
  useEffect(() => {
    fetchUser(userId).then(setUser);
  }, []); // Missing userId dependency
  
  return <div>{user?.name}</div>;
}
$ splat squash "npm start"

 Warning: React Hook useEffect has a missing dependency: 'userId'

 Analysis:
  useEffect depends on userId but it's not in dependency array
  This can cause stale data when userId changes

 Suggested fix:
  Add userId to dependency array: [userId]
Before
function App() {
  return (
    <div>
      <img src={logo} alt="logo"
      <p>Welcome</p>
    </div>
  );
}
$ splat squash "npm start"

 Error: Parsing error: Unexpected token
 File: src/App.js:4

 Fix: Close self-closing <img> tag with />

Next.js

splat squash "npm run dev"
Next.js-Specific Examples:
Before: app/page.tsx
'use client'  // Client component

import { cookies } from 'next/headers'  // Server-only API

export default function Page() {
  const cookieStore = cookies()  // Error!
  return <div>...</div>
}
$ splat squash -r "npm run dev"

 Error: You're importing a server-only module in a Client Component

 Analysis:
  'use client' directive makes this a Client Component
  cookies() only works in Server Components

 Suggested fix:
  Remove 'use client' directive or move cookies() call to Server Component

Vue.js

splat squash "npm run serve"

Angular

splat squash "ng serve"

Backend Frameworks

Express.js

splat squash "node server.js"
Express Common Errors:
Before
app.use('/api', apiRouter);
app.use(express.json());  // JSON parser should be before routes

app.post('/api/users', (req, res) => {
  console.log(req.body);  // undefined!
});
$ splat squash -r "node server.js"

 Error: req.body is undefined in POST handler

 Analysis:
  express.json() middleware is registered after routes
  Request body won't be parsed when handler runs

 Suggested fix:
  Move app.use(express.json()) before route definitions

Ruby on Rails

splat squash "rails server"

Spring Boot

splat squash "./mvnw spring-boot:run"

Compiled Languages

Go

splat squash "go run main.go"
Go Error Examples:
$ splat squash "go run main.go"

 Error: undefined: fmt
 File: main.go:5

 Analysis: Missing import for fmt package
 Fix: Add import "fmt" at top of file

Rust

splat squash "cargo run"
Rust Error Examples:
$ splat squash "cargo run"

 Error: borrow of moved value: `s`
 File: src/main.rs:12

 Analysis:
  Variable 's' moved into function and can't be used after
  Rust ownership rules prevent use after move

 Suggested fix:
  Clone the value: function(s.clone())
  Or use reference: function(&s)

Java

splat squash "javac Main.java"

Framework Detection Reference

Splat detects frameworks using this priority:
1

Command Pattern

Checks if command contains framework-specific keywords:
  • uvicorn → FastAPI
  • npm run dev, next → Next.js
  • rails server → Ruby on Rails
2

Project Files

Looks for characteristic files:
  • next.config.js, pages/ → Next.js
  • manage.py, settings.py → Django
  • Cargo.toml → Rust
3

File Extensions

Analyzes file extensions in command:
  • .go → Go
  • .rs → Rust
  • .py → Python
4

Package Dependencies

Parses package.json, requirements.txt, etc.:
  • "next" in dependencies → Next.js
  • "fastapi" in requirements → FastAPI

Best Practices by Framework

Web Frameworks

  • Use -r for debugging API endpoints
  • Include database models in analysis
  • Check middleware order issues

Frontend Frameworks

  • Run from project root
  • Use -r for component dependencies
  • Check build errors with standard mode first

Compiled Languages

  • Use -r for multi-file projects
  • Compilation errors usually need standard mode
  • Runtime errors benefit from relational analysis

Microservices

  • Run Splat in each service directory
  • Use -r for inter-service communication errors
  • Check configuration issues across services

Unsupported Frameworks?

Splat works with any language or framework that produces error output. If your framework isn’t listed here, just use the standard command pattern:
splat squash "<your-normal-command>"
Splat will analyze the error and provide fixes regardless of framework.

Next Steps

Build docs developers (and LLMs) love