{"record":{"id":"54832034a8704a45","repo":"apple/pkl","slug":"cannotresolvedependencynoproject","errorCode":"cannotResolveDependencyNoProject","errorMessage":"cannotResolveDependencyNoProject","messagePattern":"cannotResolveDependencyNoProject","errorType":"error_code","errorClass":"PackageLoadError","httpStatus":null,"severity":"error","filePath":"pkl-core/src/main/java/org/pkl/core/EvaluatorImpl.java","lineNumber":451,"sourceCode":"\n    handleTimeout(timeoutTask);\n    return evalResult;\n  }\n\n  /** Resolve dependency notation URIs (e.g. `@foo/bar.pkl`) to its resolved absolute URI. */\n  private ModuleSource normalizeModuleSource(ModuleSource moduleSource) {\n    if (moduleSource.getContents() != null\n        || moduleSource.getUri().isAbsolute()\n        || !moduleSource.getUri().getPath().startsWith(\"@\")) {\n      return moduleSource;\n    }\n    try {\n      if (projectFileUri != null) {\n        var moduleKey = moduleResolver.resolve(projectFileUri);\n        var uri = IoUtils.resolve(securityManager, moduleKey, moduleSource.getUri());\n        return ModuleSource.uri(uri);\n      } else {\n        throw new PackageLoadError(\"cannotResolveDependencyNoProject\");\n      }\n    } catch (URISyntaxException e) {\n      // impossible condition\n      throw PklBugException.unreachableCode();\n    } catch (IOException e) {\n      throw new VmExceptionBuilder()\n          .evalError(\"ioErrorLoadingModule\", moduleSource.getUri())\n          .build();\n    } catch (ExternalReaderProcessException | SecurityManagerException | PackageLoadError e) {\n      throw new VmExceptionBuilder().withCause(e).build();\n    }\n  }\n\n  private <T> T doEvaluate(ModuleSource moduleSource, Function<VmTyped, T> doEvaluate) {\n    return doEvaluate(\n        () -> {\n          var moduleKey = moduleResolver.resolve(normalizeModuleSource(moduleSource));\n          var module = VmLanguage.get(null).loadModule(moduleKey);","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/apple/pkl/blob/f3efcbfc9b60d30053b0536d664948d7aa1b8673/pkl-core/src/main/java/org/pkl/core/EvaluatorImpl.java#L433-L469","documentation":"Sentinel error in EvaluatorImpl.normalizeModuleSource: a dependency notation URI like `@foo/bar.pkl` cannot be resolved because no project context is available (projectFileUri is null). Dependency shorthand imports only work when the evaluator was given a project whose dependencies map notation URIs to resolved absolute package URIs.","triggerScenarios":"Thrown at pkl-core/src/main/java/org/pkl/core/EvaluatorImpl.java:451 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a project on the evaluator (setProject/applyFromProject) so `@` dependency imports can be resolved.","Use the fully resolved absolute URI of the module instead of dependency notation."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f3efcbfc9b60d30053b0536d664948d7aa1b8673","analyzedAt":"2026-09-08T13:10:45.570Z","contentChangedAt":"2026-09-08T13:10:45.570Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}