{"record":{"id":"95553359982523da","repo":"apple/pkl","slug":"noresourcereaderregistered-955533","errorCode":"noResourceReaderRegistered","errorMessage":"noResourceReaderRegistered","messagePattern":"noResourceReaderRegistered","errorType":"error_code","errorClass":"VmException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/runtime/ResourceManager.java","lineNumber":64,"sourceCode":"  public ResourceManager(SecurityManager securityManager, Collection<ResourceReader> readers) {\n    this.securityManager = securityManager;\n\n    for (var reader : readers) {\n      resourceReaders.put(reader.getUriScheme(), reader);\n    }\n\n    resourceFactory =\n        new VmObjectFactory<Resource>(BaseModule::getResourceClass)\n            .addProperty(\"uri\", resource -> resource.uri().toString())\n            .addProperty(\"text\", Resource::getText)\n            .addProperty(\"bytes\", resource -> new VmBytes(resource.bytes()));\n  }\n\n  @TruffleBoundary\n  public ResourceReader getReader(URI resourceUri, Node readNode) {\n    var reader = resourceReaders.get(resourceUri.getScheme());\n    if (reader == null) {\n      throw new VmExceptionBuilder()\n          .withLocation(readNode)\n          .evalError(\"noResourceReaderRegistered\", resourceUri.getScheme())\n          .build();\n    }\n    return reader;\n  }\n\n  public Optional<Object> doRead(ResourceReader reader, URI uri, @Nullable Node readNode) {\n    Optional<Object> resource;\n    try {\n      resource = reader.read(uri);\n    } catch (IOException e) {\n      throw new VmExceptionBuilder()\n          .evalError(\"ioErrorReadingResource\", uri)\n          .withCause(e)\n          .withOptionalLocation(readNode)\n          .build();\n    } catch (URISyntaxException e) {","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/runtime/ResourceManager.java#L46-L82","documentation":"ResourceManager.getReader() looks up a ResourceReader by the resource URI's scheme. If none is registered for that scheme it throws eval error 'noResourceReaderRegistered' naming the scheme, meaning Pkl cannot read resources of that kind.","triggerScenarios":"Calling getReader(URI, Node) (via resource read paths in Pkl code, e.g. `read(\"env:FOO\")` or custom scheme) where resourceReaders.get(scheme) returns null.","commonSituations":"Using a custom scheme like 'env:foo' when the env resource reader is not registered; typos in scheme; embedded usage where the application only registered a subset of readers (e.g. no http reader).","solutions":["Fix the scheme typo in the read() call (e.g. 'prop:', 'env:', 'file:', 'https:').","In embedded usage, register a ResourceReader for the scheme when building the evaluator.","Check that the Pkl version/CLI config enables the reader you expect (e.g. http reads may be restricted)."],"exampleFix":"// before\nread(\"environment:PATH\")\n// after\nread(\"env:PATH\")","handlingStrategy":"validation","validationCode":"String scheme = resourceUri.getScheme();\nif (scheme == null || !registeredSchemes.contains(scheme)) { /* avoid read or register a reader */ }","typeGuard":null,"tryCatchPattern":"catch (VmException e) { if (\"noResourceReaderRegistered\".equals(e.getCode())) { /* handle unsupported scheme */ } }","preventionTips":["Use documented schemes: env:, prop:, file:, https:, modulepath:, projectpackage:.","In embedded use, pass the needed ResourceReaders when building the evaluator."],"tags":["resource-read","scheme","configuration"],"backgroundTag":"missing-dependency","analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}