首页 > 解决方案 > 在智能感知上显示模块时找不到模块

问题描述

我正在尝试根据提供的放大文档导入突变、查询和订阅。

import * as queries from './graphql/queries';
import * as mutations from './graphql/mutations';
import * as subscriptions from './graphql/subscriptions';

但是,当我实际尝试将其应用于我的项目时,它给了我错误 TS2307。

有错误的图像

即使它出现在我的智能感知上,如下图所示。

Intellisense 能够找到文件

我一生都无法弄清楚为什么,用谷歌搜索了错误,用谷歌搜索了情况,但没有明确的答案能够解决我的问题......

编辑:我的 tsconfig 文件按要求。

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

标签: javascriptangulartypescriptgraphqlaws-amplify

解决方案


推荐阅读