How to fix the bug of Aheadworks OneStepCheckout not showing a payment module on the frontend checkout screen?

The Aheadworks OneStepCheckout contains a bug: it does not wait for payment modules initalization on the frontend checkout screen, so some payment modules could randomly abent at checkout.
To fix this bug, add your module’s initialization script to the define section of the app/code/Aheadworks/OneStepCheckout/view/frontend/web/js/view/payment-method/list.js file.

For example, to make my Stripe module compatible with Aheadworks OneStepCheckout:

locate the code block:

define(
    [
        'jquery',
        'ko',
        'underscore',
        'uiComponent',
        'uiLayout',
        'mageUtils',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/payment/method-list',
        'Magento_Checkout/js/model/payment/renderer-list',
        'Magento_Checkout/js/model/payment-service',
        'Magento_Checkout/js/model/payment/method-converter',
        'Magento_Checkout/js/model/checkout-data-resolver',
        'Aheadworks_OneStepCheckout/js/model/render-postprocessor',
        'Aheadworks_OneStepCheckout/js/model/payment-methods-service',
        'Aheadworks_OneStepCheckout/js/model/checkout-data-completeness-logger'
    ],

and and replace it with the following one:

define(
    [
        'jquery',
        'ko',
        'underscore',
        'uiComponent',
        'uiLayout',
        'mageUtils',
        'Magento_Checkout/js/model/quote',
        'Magento_Checkout/js/model/payment/method-list',
        'Magento_Checkout/js/model/payment/renderer-list',
        'Magento_Checkout/js/model/payment-service',
        'Magento_Checkout/js/model/payment/method-converter',
        'Magento_Checkout/js/model/checkout-data-resolver',
        'Aheadworks_OneStepCheckout/js/model/render-postprocessor',
        'Aheadworks_OneStepCheckout/js/model/payment-methods-service',
        'Aheadworks_OneStepCheckout/js/model/checkout-data-completeness-logger'
        ,'Dfe_Stripe/loader'
    ],

As you can see, the ,'Dfe_Stripe/loader' line was added.

Then re-deploy the static content.

A similar issue with Mageplaza One Step Checkout is fixed in the 3.9.7 version of the mage2pro/core package.

It maybe fix also the bug in the Aheadworks OneStepCheckout module (without patching Aheadworks OneStepCheckout).