You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TypeScript引入Solid Client JS报Module has no exported member错误

解决方案

这个报错是@inrupt/solid-client内部类型声明和本地TypeScript配置/版本不匹配导致的,不需要修改依赖源码,按以下步骤操作即可解决:

  • 先修正本地导入代码的语法错误:你写的导入语句前后引号不匹配,修改为:
import { getFile } from '@inrupt/solid-client';
  • 在tsconfig.json的compilerOptions中新增skipLibCheck: true配置,该配置会跳过所有第三方依赖的类型声明文件检查,不会影响本地业务代码的类型校验效果,修改后的配置示例:
{
    "compilerOptions": {
      "module": "commonjs",
      "target": "es2015",
      "declaration": true,
      "outDir": "./dist",
      "baseUrl": ".",
      "skipLibCheck": true
    },
    "include": [
      "src/**/*"
    ]
}
  • 检查本地TypeScript版本,@inrupt/solid-client稳定版要求TypeScript版本≥4.7,版本过低可执行以下命令升级:
    npm install -D typescript@latest
  • 若完成上述操作后仍报错,可卸载当前依赖后重新安装稳定版:
    npm uninstall @inrupt/solid-client && npm install @inrupt/solid-client

内容的提问来源于stack exchange,提问作者Lucas Domingues

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.03 22:39:02