microsoft / microsoft/AdaptiveCards

3.0.5 throws when loaded with ES6 imports

Open
#9,155 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Seems like there are some problems in 3.0.5, and wondering if there is any other issue to track.

repro steps:

{
  "type": "module",
  "dependencies": {
    "adaptivecards": "^3.0.5"
  }
}
import { AdaptiveCard} from 'adaptivecards';

const myCard = new AdaptiveCard();
console.log(myCard);

Fails with

node:internal/modules/esm/resolve:257
    throw new ERR_MODULE_NOT_FOUND(
          ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'D:\source\adaptcards3test\node_modules\adaptivecards\lib\strings' imported from D:\source\adaptcards3test\node_modules\adaptivecards\lib\adaptivecards.js
    at finalizeResolution (node:internal/modules/esm/resolve:257:11)
    at moduleResolve (node:internal/modules/esm/resolve:913:10)
    at defaultResolve (node:internal/modules/esm/resolve:1037:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:650:12)
    at #cachedDefaultResolve (node:internal/modules/esm/loader:599:25)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:582:38)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:132:49) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///D:/source/adaptcards3test/node_modules/adaptivecards/lib/strings'
}

Node.js v22.11.0

Originally posted by @rido-min in #8319

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the shown package.json and import under Node.js. Inspect the published adaptivecards/lib/adaptivecards.js import and the missing lib/strings resolution; done means the ES6 import creates an AdaptiveCard without ERR_MODULE_NOT_FOUND.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.