Skip to content

[BUG] typescript compilation error when using v1.2.0 #2369

@jeremymeng

Description

@jeremymeng

Description/Screenshot

One of our Azure SDK packages has a dependency on @microsoft/applicationinsights-web-snippet, after we upgrade from v1.1.2 to v1.2.0, we got this compilation error from TypeScript compiler. Looks that your type definition references @microsoft/applicationinsights-web, but it is only a dev dependency https://github.com/microsoft/ApplicationInsights-JS/blob/main/tools/applicationinsights-web-snippet/package.json#L35, so when users install @microsoft/applicationinsights-web-snippet they will not have @microsoft/applicationinsights-web

../../../common/temp/node_modules/.pnpm/@microsoft+applicationinsights-web-snippet@1.2.0/node_modules/@microsoft/applicationinsights-web-snippet/types/applicationinsights-web-snippet.d.ts:15:32 - error TS2307: Cannot find module '@microsoft/applicationinsights-web' or its corresponding type declarations.

15 import { IConfiguration } from '@microsoft/applicationinsights-web';
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in ../../../common/temp/node_modules/.pnpm/@microsoft+applicationinsights-web-snippet@1.2.0/node_modules/@microsoft/applicationinsights-web-snippet/types/applicationinsights-web-snippet.d.ts:15

Steps to Reproduce
probably include @microsoft/applicationinsights-web-snippet 1.2.0 in a typescript project as a direct dependency then build the project

  • OS/Browser:
  • SDK Version [e.g. 22]:
  • How you initialized the SDK:

Expected behavior

No breaking changes between minor version increment.

Additional context
related Azure SDK for JS issue: Azure/azure-sdk-for-js#30224

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions