{"record":{"id":"8ef36a0d92d8f7e3","repo":"octobercms/october","slug":"there-is-no-page-that-uses-the-necessary-component","errorCode":null,"errorMessage":"There is no page that uses the necessary component","messagePattern":"There is no page that uses the necessary component","errorType":"exception","errorClass":"October\\Rain\\Exception\\ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/tailor/behaviors/PreviewController.php","lineNumber":63,"sourceCode":"     * setPreviewPageContext\n     */\n    public function setPreviewPageContext(string $componentName, Blueprint $activeSource)\n    {\n        $this->componentName = $componentName;\n        $this->activeSource = $activeSource;\n    }\n\n    /**\n     * onPreview previews the record\n     */\n    public function onPreview($recordId = null)\n    {\n        if (!System::hasModule('Cms')) {\n            throw new ApplicationException('Cannot preview without the CMS module installed!');\n        }\n\n        if (!$pageName = $this->getPreviewPageName()) {\n            throw new ApplicationException('There is no page that uses the necessary component');\n        }\n\n        // Get model from page action\n        $model = $this->controller->formGetModel();\n\n        // Update the record for preview\n        $this->performSaveOnModel(\n            $model,\n            $this->controller->formGetWidget()->getSaveData(),\n            $this->controller->formGetWidget()->getSessionKey()\n        );\n\n        // A preview page is already open\n        if ($existingToken = post('preview_token')) {\n            return [\n                'token' => $existingToken,\n            ];\n        }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/tailor/behaviors/PreviewController.php#L45-L81","documentation":"Error \"There is no page that uses the necessary component\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/tailor/behaviors/PreviewController.php:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}