{"record":{"id":"765439ca1b6c1964","repo":"apple/pkl","slug":"cannotgloburi","errorCode":"cannotGlobUri","errorMessage":"Cannot expand glob pattern `{0}` because scheme `{1}` is not globbable.","messagePattern":"Cannot expand glob pattern `(.+?)` because scheme `(.+?)` is not globbable\\.","errorType":"error_code","errorClass":"VmException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/ast/expression/unary/ImportGlobNode.java","lineNumber":80,"sourceCode":"              sourceSection,\n              \"\",\n              language,\n              new FrameDescriptor(),\n              new ImportGlobMemberBodyNode(sourceSection, language, currentModule));\n    }\n    return memberNode;\n  }\n\n  @Override\n  public Object executeGeneric(VirtualFrame frame) {\n    if (cachedResult != null) return cachedResult;\n\n    CompilerDirectives.transferToInterpreterAndInvalidate();\n    var context = VmContext.get(this);\n    try {\n      var moduleKey = context.getModuleResolver().resolve(importUri, this);\n      if (!moduleKey.isGlobbable()) {\n        throw exceptionBuilder()\n            .evalError(\"cannotGlobUri\", importUri, importUri.getScheme())\n            .build();\n      }\n      var resolvedElements =\n          GlobResolver.resolveGlob(\n              context.getSecurityManager(),\n              moduleKey,\n              currentModule.getOriginal(),\n              currentModule.getUri(),\n              globPattern);\n      var builder = new VmObjectBuilder(resolvedElements.size());\n      for (var entry : resolvedElements.entrySet()) {\n        builder.addEntry(entry.getKey(), getMemberNode());\n      }\n      cachedResult = builder.toMapping(resolvedElements);\n      return cachedResult;\n    } catch (IOException e) {\n      throw exceptionBuilder().evalError(\"ioErrorResolvingGlob\", importUri).withCause(e).build();","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/expression/unary/ImportGlobNode.java#L62-L98","documentation":"Pkl throws this when a glob import's URI targets a scheme that does not support glob expansion. Each module scheme declares whether it is globbable; the resolver refuses to expand globs over schemes that cannot enumerate children (e.g. https), reporting the import URI and its scheme.","triggerScenarios":"Writing `import \"https://example.com/conf/*.pkl\" as conf*` or any glob import over a non-globbable scheme such as https/http; only local file and some package schemes support globs.","commonSituations":"Assuming remote URLs can be glob-imported like local files; migrating a file-based glob import to a hosted URL without realizing enumeration is impossible over HTTP.","solutions":["Change the glob import to a globbable scheme, e.g. file paths within the project.","List the remote modules explicitly with separate import statements instead of a glob.","If resources come from a package, check the package's supported globbing scheme.","Use a local mirror/checkout of the remote files, then glob locally."],"exampleFix":"// before\nimport \"https://example.com/envs/*.pkl\" as envs*\n// after\nimport \"./envs/*.pkl\" as envs*","handlingStrategy":"validation","validationCode":"// Only use glob syntax with file-based (or otherwise globbable) imports:\n// globImport only if uri.startsWith(\"file:\") or a known globbable package scheme","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Glob only local file paths, not https/http URLs.","For remote modules, import them explicitly one by one.","Check scheme documentation before using * or ** in an import."],"tags":["glob","import","uri","pkl"],"backgroundTag":"unsupported-operation","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"}