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

[identity] Migrate to ESM #30821

Open
maorleger opened this issue Aug 20, 2024 · 0 comments
Open

[identity] Migrate to ESM #30821

maorleger opened this issue Aug 20, 2024 · 0 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@maorleger
Copy link
Member

This issue tracks migrating identity to ESM, vitest, and tshy

There are a few blockers for identity that we still need to resolve as part of this, and it'll likely benefit from migrating later on after more packages have migrated.

Issues:

Rush Multi-Project Build Tool 5.120.6 - Node.js 20.10.0 (LTS)
> "dev-tool run test:vitest --no-test-proxy"

[dev-tool/register] Rewrote import of "@azure/identity" to "../../../../../sdk/identity/identity/src/index".
Trace: [Internal Error] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/maorleger/workspace/azure-sdk-for-js/sdk/identity/identity/src/index.ts
require() of ES modules is not supported.
require() of /home/maorleger/workspace/azure-sdk-for-js/sdk/identity/identity/src/index.ts from /home/maorleger/workspace/azure-sdk-for-js/common/tools/dev-tool/src/util/browserRelayServer.ts is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /home/maorleger/workspace/azure-sdk-for-js/sdk/identity/identity/package.json.

Is the error due to this

  • node:http is being mocked in the test setup; however, a better approach is to pass a custom httpClient with the correct responses as done in this proof-of-concept
@maorleger maorleger added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Aug 20, 2024
@maorleger maorleger added this to the Backlog milestone Aug 20, 2024
@maorleger maorleger self-assigned this Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library.
Projects
Status: Untriaged
Development

No branches or pull requests

1 participant