You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
@azure-tools/test-* packages use @azure/identity as a dependency for the test credential. Because of how dev-tool rewrites imports for the package under test we will need to figure out how to exclude this rewrite when testing identity, or scope it to avoid rewriting files in test-credential for identity imports
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
The text was updated successfully, but these errors were encountered:
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:
@azure/identity
as a dependency for the test credential. Because of how dev-tool rewrites imports for the package under test we will need to figure out how to exclude this rewrite when testing identity, or scope it to avoid rewriting files in test-credential for identity importsIs the error due to this
The text was updated successfully, but these errors were encountered: