{"record":{"id":"4de3318a159e26ca","repo":"apple/pkl","slug":"cannotglobtripledots","errorCode":"cannotGlobTripleDots","errorMessage":"cannotGlobTripleDots","messagePattern":"cannotGlobTripleDots","errorType":"error_code","errorClass":"VmException","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/ast/builder/AstBuilder.java","lineNumber":755,"sourceCode":"  }\n\n  @Override\n  public TraceNode visitTraceExpr(TraceExpr expr) {\n    return new TraceNode(createSourceSection(expr), visitExpr(expr.getExpr()));\n  }\n\n  @Override\n  public AbstractImportNode visitImportExpr(ImportExpr expr) {\n    var importUriCtx = expr.getImportStr();\n    return doVisitImport(expr.isGlob(), expr, importUriCtx);\n  }\n\n  private AbstractImportNode doVisitImport(\n      boolean isGlobImport, Node node, StringConstant importUriNode) {\n    var section = createSourceSection(node);\n    var importUri = importUriNode.getString();\n    if (isGlobImport && importUri.startsWith(\"...\")) {\n      throw exceptionBuilder().evalError(\"cannotGlobTripleDots\").withSourceSection(section).build();\n    }\n    var resolvedUri = resolveImport(importUri, importUriNode);\n    if (isGlobImport) {\n      return new ImportGlobNode(section, moduleInfo.getResolvedModuleKey(), resolvedUri, importUri);\n    }\n    return new ImportNode(language, section, moduleInfo.getResolvedModuleKey(), resolvedUri);\n  }\n\n  @Override\n  public AbstractReadNode visitReadExpr(ReadExpr expr) {\n    return switch (expr.getReadType()) {\n      case READ ->\n          ReadNodeGen.create(createSourceSection(expr), moduleKey, visitExpr(expr.getExpr()));\n      case NULL ->\n          ReadOrNullNodeGen.create(createSourceSection(expr), moduleKey, visitExpr(expr.getExpr()));\n      case GLOB ->\n          ReadGlobNodeGen.create(createSourceSection(expr), moduleKey, visitExpr(expr.getExpr()));\n    };","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/ast/builder/AstBuilder.java#L737-L773","documentation":"Glob imports (`import* \"glob\" as ...`) require a glob pattern, but the pattern cannot begin with `...` — triple-dot prefixes are reserved/relative-parent path syntax that has no meaning for glob matching. `doVisitImport` rejects such URIs before resolving.","triggerScenarios":"Writing `import* \".../*.pkl\" as mods` — any glob import whose URI string starts with \"...\".","commonSituations":"Trying to import all modules from a parent directory by prefixing `...`, confusing Pkl's glob syntax with filesystem relative paths or other languages' import syntax.","solutions":["Remove the leading `...` and use a valid glob pattern relative to the current module.","Use the correct parent-directory syntax supported by Pkl glob imports (`../`) if importing from an ancestor directory.","Restructure the project so the target modules are in or below the current module's directory."],"exampleFix":"// before\nimport* \".../*.pkl\" as mods\n// after\nimport* \"../*.pkl\" as mods","handlingStrategy":"validation","validationCode":"// Validate glob import URIs before rendering:\nfunction isValidGlobUri(uri) {\n  return typeof uri === 'string' && uri.length > 0 && !uri.startsWith('...');\n}","typeGuard":"const isGlobSafe = (uri: string): boolean => !uri.startsWith('...');","tryCatchPattern":null,"preventionTips":["Use `../` for parent directories in glob imports, never `...`.","Test glob patterns with a small module set before scaling up."],"tags":["pkl","import","glob"],"backgroundTag":"invalid-argument-format","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"}