首页 > 解决方案 > 找不到模块“@foundry/ontology-api”或其相应的类型声明

问题描述

在分支上重构 typescript 文件时,import 语句中的 @foundry/ontology-api 模块之一出现以下错误:

[typescript] 找不到模块“@foundry/ontology-api”或其对应的类型声明

刷新页面并重新启动代码辅助并没有消除错误。

package.json 文件似乎缺少此模块的包依赖项,但是我无法找到适合此模块的参考,该参考将描述我应该使用的当前版本以及浏览代码以了解更多信息的方法关于 API。有什么办法吗?

作为参考,项目 package.json 文件包含:

{
  "name": "my-functions",
  "version": "0.0.0",
  "description": "My useful functions",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "dependencies": {
    "@foundry/functions-api": "0.43.0",
    "@foundry/functions-typescript-runtime-internal-api": "0.20.0",
    "@foundry/functions-utils": "0.1.0"
  },
  "devDependencies": {
    "@foundry/functions-typescript-authoring-dev": "0.37.0",
    "@foundry/functions-typescript-ontology-code-generator": "0.28.0",
    "@foundry/functions-typescript-discovery": "0.17.0",
    "@foundry/functions-typescript-object-set-base": "1.18.0",
    "@foundry/functions-testing-lib": "0.3.0",
    "jest": "24.9.0"
  },
  "scripts": {
    "build": "../gradlew build",
    "check": "../gradlew check",
    "test": "../gradlew test",
    "jest": "jest"
  },
  "license": "UNLICENSED"
}

标签: typescriptpalantir-foundry

解决方案


这似乎是后端的临时问题,因为 @foundry/ontology-api 模块引用现在已被 Code Assist 识别。

该模块似乎也不需要明确的项目参考(因为“转到定义”链接按预期工作)。


推荐阅读