@wppconnect/wa-js - v4.6.0
    Preparing search index...

    Function ensureLazyModule

    • Make sure a module that ships in a lazily bootloaded bundle is registered.

      WhatsApp Web >= 2.3000 splits its module graph into resource bundles the Bootloader fetches on demand, so a module whose bundle the session never needed is absent from the registry and searchId() can never find it — the binding stays undefined for the whole life of the page no matter how often it is retried. Call this before using such a binding: it asks WhatsApp to fetch the bundle exactly like the UI would, which registers the module and lets the existing lazy getters resolve.

      Best-effort by design. Returns whether moduleId is registered when it finishes; false on the legacy webpack loader (where nothing is lazy) and for modules absent from LAZY_MODULES. Each component is fetched at most once per page, so repeated calls after a failure cost nothing.

      Parameters

      • moduleId: string

        The module the caller needs

      Returns Promise<boolean>