{"record":{"id":"110cdce4d658a949","repo":"phalcon/cphalcon","slug":"service-name-cannot-be-resolved","errorCode":null,"errorMessage":"Service '{name}' cannot be resolved","messagePattern":"Service '(.+?)' cannot be resolved","errorType":"exception","errorClass":"Phalcon\\Di\\Exceptions\\ServiceCannotBeResolved","httpStatus":null,"severity":"error","filePath":"phalcon/Di/Di.zep","lineNumber":220,"sourceCode":"         */\n        if this->eventsManager !== null {\n            let instance = this->eventsManager->fire(\n                \"di:beforeServiceResolve\",\n                this,\n                [\n                    \"name\":       name,\n                    \"parameters\": parameters\n                ]\n            );\n        }\n\n        if instance === null {\n            if service !== null {\n                // The service is registered in the DI.\n                try {\n                    let instance = service->resolve(parameters, this);\n                } catch ServiceResolutionException {\n                    throw new ServiceCannotBeResolved(name);\n                }\n\n                // If the service is shared then we'll cache the instance.\n                if isShared {\n                    let this->sharedInstances[name] = instance;\n                }\n            } else {\n                /**\n                 * The DI also acts as builder for any class even if it isn't\n                 * defined in the DI\n                 */\n                if unlikely !class_exists(name) {\n                    throw Exception::serviceNotFound(name);\n                }\n\n                if typeof parameters == \"array\" && !empty parameters {\n                    let instance = create_instance_params(name, parameters);\n                } else {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Di/Di.zep#L202-L238","documentation":"Error \"Service '{name}' cannot be resolved\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Di/Di.zep:220 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":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}