Skip to content

ESM directory import fails at runtime — ERR_UNSUPPORTED_DIR_IMPORT #113

@hkbertoson

Description

@hkbertoson

Bug Description

@chat-adapter/teams is "type": "module" and the compiled output in dist/index.js contains a bare directory import:

from "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials"

Node.js ESM does not support directory imports. This fails at runtime with:

ERR_UNSUPPORTED_DIR_IMPORT: Directory import '…/authProviders/azureTokenCredentials' is not supported

Update the import to include the full file path: "@microsoft/microsoft-graph-client/authProviders/azureTokenCredentials/index.js"
Or configure tsup to bundle this dependency so the bare import doesn't appear in the output

Steps to Reproduce

Create a new chatbot with the teams adapter

Expected Behavior

It loads the bot

Actual Behavior

Not loading the bot

Code Sample

Chat SDK Version

Latest

Node.js Version

No response

Platform Adapter

Microsoft Teams

Operating System

macOS

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions