TSLint 正在抛出 'error TS2459: Module '"@azure/core-tracing"' 在本地声明 'Span',但不会导出。'和其他错误
TSLint is throwing 'error TS2459: Module '"@azure/core-tracing"' declares 'Span' locally, but it is not exported.' and other errors
我不知道从哪里开始修复这个错误。除了听起来“@azure/ai-text-analytics”安装有问题外,输出并没有真正告诉我很多信息。我已经 npm uninstall
安装了两次并重新安装了两次。它给出了同样的错误,所以我猜这不是安装?
我得到的完整错误:
node_modules/@azure/core-http/types/latest/src/createSpanLegacy.d.ts:1:10 - error TS2459: Module '"@azure/core-tracing"' declares 'Span' locally, but it is not exported.
1 import { Span } from "@azure/core-tracing";
~~~~
node_modules/@azure/core-tracing/types/core-tracing.d.ts:6:10
6 import { Span } from '@opentelemetry/api';
~~~~
'Span' is declared here.
node_modules/@azure/core-http/types/latest/src/webResource.d.ts:9:23 - error TS2305: Module '"@azure/core-tracing"' has no exported member 'Context'.
9 import { SpanOptions, Context } from "@azure/core-tracing";
~~~~~~~
Found 2 errors.
显然 none 这些文件是我自己的代码,所以我没有任何其他我能想到的东西可以证明。
我在 GitHub 支持方面得到了帮助。这是答案的link。
I did more debugging and it looks like the TypeScript compiler is trying to build the d.ts files inside node_modules which is causing the build failure. Looks like using the paths option in your tsconfig.json file caused this issue and when I removed it, the project built just fine with core-http@1.2.4.
我不知道从哪里开始修复这个错误。除了听起来“@azure/ai-text-analytics”安装有问题外,输出并没有真正告诉我很多信息。我已经 npm uninstall
安装了两次并重新安装了两次。它给出了同样的错误,所以我猜这不是安装?
我得到的完整错误:
node_modules/@azure/core-http/types/latest/src/createSpanLegacy.d.ts:1:10 - error TS2459: Module '"@azure/core-tracing"' declares 'Span' locally, but it is not exported.
1 import { Span } from "@azure/core-tracing";
~~~~
node_modules/@azure/core-tracing/types/core-tracing.d.ts:6:10
6 import { Span } from '@opentelemetry/api';
~~~~
'Span' is declared here.
node_modules/@azure/core-http/types/latest/src/webResource.d.ts:9:23 - error TS2305: Module '"@azure/core-tracing"' has no exported member 'Context'.
9 import { SpanOptions, Context } from "@azure/core-tracing";
~~~~~~~
Found 2 errors.
显然 none 这些文件是我自己的代码,所以我没有任何其他我能想到的东西可以证明。
我在 GitHub 支持方面得到了帮助。这是答案的link。
I did more debugging and it looks like the TypeScript compiler is trying to build the d.ts files inside node_modules which is causing the build failure. Looks like using the paths option in your tsconfig.json file caused this issue and when I removed it, the project built just fine with core-http@1.2.4.