3

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. I've npm uninstall'd it twice and reinstalled it twice. 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.

Sintrias
  • 456
  • 1
  • 9
  • 19
  • 1
    Same problem here, did you find a solution? – jonhobbs Jun 24 '21 at 17:12
  • Oh no. Sorry I'm just now seeing this. I did get help with this from Microsoft. The problem was with my tsconfig.json file. Here is what I have now: { "compilerOptions": { "module": "commonjs", "esModuleInterop": true, "target": "es6", "noImplicitAny": true, "moduleResolution": "node", "sourceMap": true, "outDir": "dist", "baseUrl": ".", "paths": { "*": ["node_modules/*"] } }, "include": ["src/**/*"] } – Sintrias Sep 25 '21 at 11:52

1 Answers1

1

I received help on GitHub support. 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. 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.

karel
  • 5,489
  • 46
  • 45
  • 50
Sintrias
  • 456
  • 1
  • 9
  • 19