Troubleshooting
Common Fusion setup and runtime problems
Route returns 404
| Cause | Fix |
|---|---|
| Module file never imported | Import it from main before listen() |
| C# type not registered | Call Route.Register<T>() |
| Wrong path / missing version prefix | Check version= and [module] expansion |
| Custom route template mistake | Verify @http_get / @http_post / … template and [action] |
Settings not loading
| Cause | Fix |
|---|---|
| Wrong cwd | Run from project root (fusion command run:dev) |
| Wrong env | Set FUSION_ENV or use run:prod / --prod |
Looking for flat keys but file nests under config | Framework merges config object — use settings.get("port") not settings.get("config.port") unless you stored it that way |
JWT middleware always 401
- Missing
Authorization: Bearer …header - Malformed token when using default decode
- Custom
verifyreturningNone
Roles always 403
bearer_jwtnot registered beforerequire_roles/roles=- Payload missing
rolesclaim (or custom claim name not configured)
Native / FFI errors (C#)
- Build
fusion-ffior use the NuGet-packaged native binary - Set
FUSION_FFI_PATHfor local development if the loader cannot find the library
Swagger missing
swagger.enabledis falseswagger.pathdisabled- App failed before mount — check startup exceptions
Import errors after fusion add
- Build step in
fusion.module.tomlfailed - Wrong
entrypackage name - Re-run
fusion addand read CLI output
Port already in use
Change port in fusion.<env>.json / nested config.port.