{"record":{"id":"19aeb673a4fe6e49","repo":"octobercms/october","slug":"type-must-be-one-of-typeasstring","errorCode":null,"errorMessage":"Type must be one of: {$typeAsString}.","messagePattern":"Type must be one of: (.+?)\\.","errorType":"exception","errorClass":"BlueprintException","httpStatus":null,"severity":"error","filePath":"modules/tailor/classes/BlueprintVerifier.php","lineNumber":162,"sourceCode":"            $this->yamlToBlueprintException($blueprint, $ex);\n        }\n    }\n\n    /**\n     * validateSupportedTypes checks for valid blueprint types\n     */\n    protected function validateSupportedTypes(Blueprint $blueprint)\n    {\n        $supportedTypes = ['entry', 'stream', 'structure', 'single', 'mixin', 'global'];\n\n        if (in_array($blueprint->type, $supportedTypes)) {\n            return;\n        }\n\n        $lineNo = $this->findLineFromKeyValPair($blueprint->content, 'type', $blueprint->type);\n\n        $typeAsString = implode(', ', $supportedTypes);\n        throw new BlueprintException($blueprint, \"Type must be one of: {$typeAsString}.\", $lineNo);\n    }\n\n    /**\n     * validateUniqueBlueprint checks for duplicate handles and UUIDs across blueprints\n     */\n    protected function validateUniqueBlueprint(Blueprint $blueprint)\n    {\n        $filePath = $blueprint->getFilePath();\n        $theme = $blueprint->getDatasourceTheme();\n\n        // Check handle uniqueness (all blueprints share the same namespace)\n        if ($handle = $blueprint->handle) {\n            $this->validateUniqueProperty($blueprint, 'handle', $handle, $filePath, $theme);\n        }\n\n        // Check UUID uniqueness\n        if ($uuid = $blueprint->uuid) {\n            $this->validateUniqueProperty($blueprint, 'uuid', $uuid, $filePath, $theme);","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/classes/BlueprintVerifier.php#L144-L180","documentation":"Thrown by Tailor's BlueprintVerifier while scanning blueprint YAML files: the blueprint's top-level `type:` value is not one of the six supported types (entry, stream, structure, single, mixin, global). Tailor uses the type to decide which model, table and behaviours to generate, so an unknown value aborts validation, with the offending line located via findLineFromKeyValPair.","triggerScenarios":"A blueprint file in themes/<theme>/blueprints/ contains e.g. `type: blog` or `type: entries` (plural) instead of `entry`. Validation runs when Tailor scans blueprints (opening the Tailor backend section, `php artisan tailor:refresh`, cache clear), so the exception surfaces at scan time.","commonSituations":"Typos in the type key; YAML indentation nesting `type` under another key so it parses as null or an unexpected value; blueprints copied from plugins or docs expecting a custom type; type names changed between October versions.","solutions":["Set `type:` to one of: entry, stream, structure, single, mixin, global (e.g. `type: entry`).","Check YAML indentation — `type` must be a top-level key of the blueprint file, not nested under another key.","Re-run `php artisan tailor:refresh` after fixing to confirm the blueprint passes validation."],"exampleFix":"# before (themes/mytheme/blueprints/blog.yaml)\ntype: entries\n\n# after\ntype: entry","handlingStrategy":"validation","validationCode":"$supported = ['entry', 'stream', 'structure', 'single', 'mixin', 'global'];\n$content = \\Symfony\\Component\\Yaml\\Yaml::parseFile($blueprintPath);\n$type = $content['type'] ?? null;\nif (!in_array($type, $supported, true)) {\n    throw new InvalidArgumentException(\"{$blueprintPath}: unsupported blueprint type \" . var_export($type, true));\n}","typeGuard":"function isSupportedBlueprintType($type): bool\n{\n    return in_array($type, ['entry', 'stream', 'structure', 'single', 'mixin', 'global'], true);\n}","tryCatchPattern":"try {\n    // tailor:refresh / blueprint scan\n} catch (\\Tailor\\Classes\\BlueprintException $e) {\n    // $e->getMessage() names the type and file; fix YAML and rescan\n}","preventionTips":["Lint blueprint YAML in CI: parse each file and assert `type` is one of the six supported values.","Use the official blueprint templates (scaffolds) as starting points so the type key is always present.","Run `php artisan tailor:refresh` in deploy pipelines so bad blueprints fail the deploy, not production page loads."],"tags":["tailor","blueprint","yaml","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}