Skip to content

IDK JS npm packages fail runtime import due to missing generated KMP runtime .mjs files #3

@rkreutzer

Description

@rkreutzer

I’m integrating Sphereon IDK into an Ionic/Angular holder wallet app and installed the current JS/KMP IDK npm snapshot packages:

{
  "@sphereon/idk-lib-openid-oid4vci-holder-public": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-openid-oid4vci-holder-impl": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-openid-oid4vp-holder-public": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-openid-oid4vp-holder-impl": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-mdoc-core-public": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-mdoc-core-impl": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-sdjwt-public": "^0.25.0-SNAPSHOT-build-365c86e",
  "@sphereon/idk-lib-sdjwt-impl": "^0.25.0-SNAPSHOT-build-365c86e"
}

The packages install successfully and expose TypeScript declarations, but runtime imports fail because generated Kotlin Multiplatform dependency files appear to be missing from node_modules/@sphereon.

Environment

OS: Windows
Shell: PowerShell
Node: v24.14.0
Package manager: yarn 4.13.0
Framework: Ionic/Angular
Target: holder/wallet app using OID4VCI, OID4VP, SIOPv2

Reproduction
From the app root after installing the packages:

node --input-type=module -e "const pkgs=['@sphereon/idk-lib-openid-oid4vci-holder-public','@sphereon/idk-lib-openid-oid4vci-holder-impl','@sphereon/idk-lib-openid-oid4vp-holder-public','@sphereon/idk-lib-openid-oid4vp-holder-impl']; for (const p of pkgs) { try { await import(p); console.log(p+': ok'); } catch (e) { console.log(p+': '+e.message); } }"

Actual result

@sphereon/idk-lib-openid-oid4vci-holder-public: Cannot find module '...\node_modules\@sphereon\kotlin-kotlin-stdlib.mjs' imported from ...\node_modules\@sphereon\idk-lib-openid-oid4vci-holder-public\idk-lib-openid-oid4vci-holder-public.mjs

@sphereon/idk-lib-openid-oid4vci-holder-impl: Cannot find module '...\node_modules\@sphereon\ktor-ktor-client-core.mjs' imported from ...\node_modules\@sphereon\idk-lib-openid-oid4vci-holder-impl\idk-lib-openid-oid4vci-holder-impl.mjs

@sphereon/idk-lib-openid-oid4vp-holder-public: Cannot find module '...\node_modules\@sphereon\kotlin-kotlin-stdlib.mjs' imported from ...\node_modules\@sphereon\idk-lib-openid-oid4vp-holder-public\idk-lib-openid-oid4vp-holder-public.mjs

@sphereon/idk-lib-openid-oid4vp-holder-impl: Cannot find module '...\node_modules\@sphereon\ktor-ktor-client-core.mjs' imported from ...\node_modules\@sphereon\idk-lib-openid-oid4vp-holder-impl\idk-lib-openid-oid4vp-holder-impl.mjs

Expected result
The JS/KMP packages should be importable in a browser/Node/Angular environment, or their package metadata should declare/install the required generated KMP runtime dependencies.

For example, these imports should succeed:

import type { Oid4vciHolderService } from '@sphereon/idk-lib-openid-oid4vci-holder-public'
import '@sphereon/idk-lib-openid-oid4vci-holder-impl'
import type { Oid4vpHolderService } from '@sphereon/idk-lib-openid-oid4vp-holder-public'
import '@sphereon/idk-lib-openid-oid4vp-holder-impl'

Additional details
The package files reference generated sibling runtime modules such as:

import '../kotlin-kotlin-stdlib.mjs'
import '../ktor-ktor-client-core.mjs'
import '../ktor-ktor-client-cio.mjs'
import '../cryptography-kotlin-cryptography-provider-webcrypto.mjs'

But those files are not present under node_modules/@sphereon, and they do not appear to be published as separate @sphereon/* npm packages.

I worked around this temporarily by keeping IDK imports type-only and wrapping runtime imports behind a diagnostic probe so Angular does not statically bundle the incomplete runtime path.

Question
What is the intended bootstrap/import method for using the IDK JS packages from an Ionic/Angular holder wallet app?

Specifically:

  1. Are the generated KMP runtime .mjs files supposed to be published inside each IDK package, at node_modules/@sphereon, or as separate dependencies?
  2. Is there a higher-level bootstrap package that should be installed for browser/Angular usage?
  3. Is there an example holder/wallet JS app showing concrete construction or DI binding of Oid4vciHolderService and Oid4vpHolderService?

Use case: accepting and presenting Verifiable Credentials from a holder/wallet app using OpenID4VC protocols: SIOPv2, OID4VCI, and OID4VP, including JWT VC, SD-JWT VC, and mdoc formats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions