简体   繁体   English

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

I have no idea where to start with fixing this error.我不知道从哪里开始修复这个错误。 The output doesn't really tell me a whole lot except that it sounds like something is wrong with the '@azure/ai-text-analytics' install. output 并没有真正告诉我很多,只是听起来“@azure/ai-text-analytics”安装有问题。 I've npm uninstall 'd it twice and reinstalled it twice.我已经npm uninstall两次并重新安装了两次。 It's giving the same error so I guess it isn't the install?它给出了同样的错误,所以我猜它不是安装?

The full error I get:我得到的完整错误:

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.

Obviously none of those files are my own code so I don't have anything else to show that I can think of.显然,这些文件都不是我自己的代码,所以我没有其他任何东西可以展示我能想到的。

I received help on GitHub support.我收到了有关 GitHub 支持的帮助。 Here's the link to the answer.这是答案的链接

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.我做了更多调试,看起来 TypeScript 编译器正在尝试在 node_modules 中构建 d.ts 文件,这导致构建失败。 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.看起来像使用 tsconfig.json 文件中的路径选项导致了这个问题,当我删除它时,使用 core-http@1.2.4 构建的项目很好。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我收到此错误:声明&#39;<MODULE> &#39; 在本地,但不会导出 - Why I am getting this error: declares '<MODULE>' locally, but it is not exported JavaScript:toDataUrl()抛出“安全错误:可能无法导出受污染的画布”。 - JavaScript: toDataUrl() throwing “Security Error: Tainted canvases may not be exported.” 从视频提升创建的画布“可能无法导出受污染的画布。” 保存时出错 - Canvas that created from video raising "Tainted canvases may not be exported." error when saving 为什么收到错误“未捕获的SecurityError:无法在&#39;HTMLCanvasElement&#39;上执行&#39;toDataURL&#39;:错误的画布可能无法导出。 ” - Why am I getting the error “Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. ” 错误 TS2305:模块 @types/angular 没有导出的成员“cookies” - Error TS2305: Module @types/angular has no exported member 'cookies' 预先加载的模块-是否在核心模块中导入或导出? - Eagerly loaded module - Imported or Exported in core module? 方法中一行的tslint错误 - tslint errors for a line in a method 试图将 span 附加到列表 appendchild(span) 中,它会引发错误吗? - Tried to append span into list appendchild(span) it is throwing an error? 导出模块并在导入时抛出错误/停止执行 - Export module and throwing errors/stopping execution on import Webpack错误:模块没有导出成员&#39;Rgb&#39; - Webpack error: Module has no exported member 'Rgb'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM