Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeremymeng opened this issue Jun 28, 2024 · 3 comments
Closed

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

jeremymeng opened this issue Jun 28, 2024 · 3 comments
Assignees
Milestone

Comments

@jeremymeng
Copy link
Member

jeremymeng commented Jun 28, 2024

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

@jeremymeng jeremymeng changed the title [BUG] [BUG] typescript compilation error when using v1.2.0 Jun 28, 2024
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Jun 28, 2024
…ersion

our `rush update --full` automation introduced a compilation error due to

microsoft/ApplicationInsights-JS#2369

This PR pins its version to 1.1.2 until the issue is fixed.
jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Jul 1, 2024
…ersion

our `rush update --full` automation introduced a compilation error due to

microsoft/ApplicationInsights-JS#2369

This PR pins its version to 1.1.2 until the issue is fixed.
jeremymeng added a commit to Azure/azure-sdk-for-js that referenced this issue Jul 1, 2024
…ersion (#30233)

our `rush update --full` automation introduced a compilation error due
to

microsoft/ApplicationInsights-JS#2369

This PR pins its version to 1.1.2 until the issue is fixed.
@siyuniu-ms
Copy link
Contributor

Hi, thanks for the information. We will make a new release which avoid the web package dependency.

@MSNev
Copy link
Collaborator

MSNev commented Jul 9, 2024

Note: that it will cause the definition of IConfiguration to be replaced with any, so you won't get any TypeScript type support for the cfg :-(.
The only way we can easily include the IConfiguration into the web-snippet is to either duplicate a lot of configurations, copy them during build, attempt to re-export them from the snippet, or move the @microsoft/applicationinsights-web to either a peerDependency (with a wide range) or as a dependency.

We had a previous issue where consumers did not want to have @microsoft/applicationinsights-web included as a direct dependency and I would assume also as a peerDependency (as this would require them to install it). So the quickest resolution is the any (for now) and we will look to add back support in a later release.

@siyuniu-ms
Copy link
Contributor

siyuniu-ms commented Jul 10, 2024

https://www.npmjs.com/package/@microsoft/applicationinsights-web-snippet version 1.2.1 is published now. This bug is fixed.

jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Jul 10, 2024
Now that microsoft/ApplicationInsights-JS#2369 has
been fixed.

Revert "[EngSys] temporarily pin @microsoft/applicationinsights-web-snippet version (Azure#30233)"

This reverts commit 1df8d78.
jeremymeng added a commit to Azure/azure-sdk-for-js that referenced this issue Jul 10, 2024
…0369)

Now that microsoft/ApplicationInsights-JS#2369
has
been fixed.

Revert "[EngSys] temporarily pin
@microsoft/applicationinsights-web-snippet version (#30233)"

This reverts commit 1df8d78.
@siyuniu-ms siyuniu-ms added this to the webldr-1.2.1 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants