Open rewrlution opened 10 months ago
@rewrlution ESM support is definitely on our roadmap, but can you clarify what runtime you're targeting? Are you using node's native ESM support, bun, deno, or some kind of bundler for browsers?
Hi @rewrlution. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @rewrlution, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Here's the scenario:
@azure/identity
. More specifically, the azureTokenCredentials
class.@azure/identity
has a dependency on open
, which is CJS, it causes some incompatibility issue.My question is: do you have the ESM version of the @azure/identity
library?
My question is: do you have the ESM version of the
@azure/identity
library?
Not today, but I believe it will be one of the first to support ESM natively besides core. /cc @mpodwysocki who is working on the core ESM migration
Got it. Any chance that your team has an ETA for the ESM migration?
Got it. Any chance that your team has an ETA for the ESM migration?
I don't have a specific ETA, though we don't plan to ship a new version of Identity this month in order to avoid introducing bugs during the holidays.
I think open
is only used for the InteractiveBrowserCredential
so if you don't need that credential type you may be able to configure things such that it is never loaded/used. For example, I think you could use overrides in your package.json
to replace open
with a local stub written in ESM package that exports a no-op function.
@xirzec thanks for your reply! Yes, we realized that open
is only used for the interactive flow while all we need is the client credential flow. and yes, this is what we are doing right now, using the overrides
option.
Got it.
@rewrlution glad you were able to mitigate. We'll keep working on official ESM support so that hopefully this won't be needed in the future.
Thanks @xirzec
I am running into this issue using Node v20 in AWS Lambda bundled for ESM. Will do the overrides
workaround for now
Any news on this?
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I tried to use
@azure/identity
in anESM
only application, but ran into an issue. The root cause is that@azure/identity
has a dependency on aCJS
module:open
.Describe the solution you'd like I want to use
@azure/identity
in an ESM only environment.