ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

[BUG] typescript compilation error when using v1.2.0

Open jeremymeng opened this issue 1 year ago • 0 comments

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/@[email protected]/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/@[email protected]/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: https://github.com/Azure/azure-sdk-for-js/issues/30224

jeremymeng avatar Jun 28 '24 06:06 jeremymeng