usebruno/bruno · error · Error

Unsupported item type: ${item.type}

Error message

Unsupported item type: ${item.type}

What it means

`stringifyItem` switches on `item.type` and supports `http-request|graphql-request|grpc-request|ws-request|js|app`; it throws on `folder` and falls through to a default for anything else. This is the serialization-side mirror of the parse error, keyed on Bruno's internal runtime item types.

Source

Thrown at packages/bruno-filestore/src/formats/yml/stringifyItem.ts:34

        return stringifyGraphqlRequest(item);

      case 'grpc-request':
        return stringifyGrpcRequest(item);

      case 'ws-request':
        return stringifyWebsocketRequest(item);

      case 'js':
        return stringifyScript(item);

      case 'app':
        return stringifyApp(item);

      case 'folder':
        throw new Error('Folder items should be handled separately using stringifyFolder');

      default:
        throw new Error(`Unsupported item type: ${item.type}`);
    }
  } catch (error) {
    console.error('Error stringifying item:', error);
    throw error;
  }
};
export default stringifyItem;

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Confirm `item.type` is one of: http-request, graphql-request, grpc-request, ws-request, js, app.
  2. Use `stringifyFolder` for folder objects.
  3. Upgrade bruno-filestore / schema packages together so all item types have serializers.
  4. Construct items through the official factories rather than ad-hoc literals.

Example fix

// before
stringifyItem({ type: 'http', ... });   // wrong type value

// after
stringifyItem({ type: 'http-request', ... });
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = new Set(['http-request','graphql-request','grpc-request','ws-request','js','app']);
function assertStringifiableType(t) {
  if (!SUPPORTED.has(t)) throw new Error(`Unsupported item type: ${t}`);
}

Type guard

const STRINGIFY_TYPES = ['http-request','graphql-request','grpc-request','ws-request','js','app'] as const;
type StringifyType = typeof STRINGIFY_TYPES[number];
function isStringifyType(t: unknown): t is StringifyType {
  return typeof t === 'string' && (STRINGIFY_TYPES as readonly string[]).includes(t);
}

Try / catch

try { stringifyItem(item); }
catch (e) { if (/Unsupported item type/.test(e.message)) { /* route to stringifyFolder or upgrade */ } else throw e; }

Prevention

When it happens

Trigger: Passing an item object whose `.type` is not one of the supported serialization types (and not `folder`), e.g. an unknown/unsupported runtime item or a folder handed to `stringifyItem`.

Common situations: A new item type was added to the runtime model without a matching `stringifyX`; passing a folder object to `stringifyItem` instead of `stringifyFolder`; a malformed item object missing/with a wrong `.type`; version skew between the schema package and filestore.

Related errors


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/5298ffb3d07b471a. Report an issue: GitHub.