Title: Type error: e is undefined
Last modified: January 29, 2024

---

# Type error: e is undefined

 *  Resolved [webmonk](https://wordpress.org/support/users/webmonk/)
 * (@webmonk)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/)
 * `plugins/checkout-for-woocommerce/build/js/default-checkout-order-pay-7c2d873e1953684f44e0.
   js`[](https://wordpress-875867-3059000.cloudwaysapps.com/wp-content/plugins/checkout-for-woocommerce/build/js/default-checkout-order-pay-7c2d873e1953684f44e0.js?ver=cc307ca8582f8d98539a0d56e1d2de84)
 * in `createAlertsFromMessages` at line `1:7240`
 *     ```wp-block-code
       {snip} m(),cfw-alert-success ${t});n.queueAlert(a),r=!0})),-1!==e.indexOf("<script")&&jQuery(document.body).prepend(`<div style="display:none">${ {snip}
       ```
   
 * This is the error message when a user tries to checkout and there’s an error 
   notice to be displayed on the checkout page.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [webmonk](https://wordpress.org/support/users/webmonk/)
 * (@webmonk)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/#post-17381839)
 * The bug is in AlertService.ts file. 
   messages is undefined here:
 * `_if _( messages.indexOf( '<script' ) !== -1 ) {
   jQuery( document.body ).prepend(
   
   <div style="display:none">${messages}</div> );
   }
    -  This reply was modified 2 years, 2 months ago by [webmonk](https://wordpress.org/support/users/webmonk/).
 *  Thread Starter [webmonk](https://wordpress.org/support/users/webmonk/)
 * (@webmonk)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/#post-17381932)
 * I found the fix for this.
   In CompleteOrderAction.ts, you have triple “s” in resp.
   messages`AlertService.createAlertsFromMessages( resp.messsages );`
 * `if ( typeof resp.messages === 'string' && resp.messages.length ) { AlertService.
   createAlertsFromMessages( resp.messsages ); } else { /** * If the payment gateway
   comes back with no message, show a generic error. */ const message = DataService.
   getCheckoutParam( 'i18n_checkout_error' ).toString(); const rawResponse = JSON.
   stringify( resp, null, 2 ); const alert: Alert = new Alert( 'error', message,'
   cfw-alert-error', ); AlertService.queueAlert( alert ); // Console log the error
   + raw response LoggingService.logError( ``${message}\n\n${rawResponse}` ); } //
   Trigger update in case we need a fresh nonce if ( resp.refresh === true ) { jQuery(
   document.body ).trigger( 'update_checkout' ); }
 *  Thread Starter [webmonk](https://wordpress.org/support/users/webmonk/)
 * (@webmonk)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/#post-17381936)
 * Do you have a github repository for this plugin? I can fix and submit a PR.
 *  Plugin Author [Clifton Griffin](https://wordpress.org/support/users/clifgriffin/)
 * (@clifgriffin)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/#post-17389105)
 * Hi there – so sorry about this. Fix is up now: 1.1.7
 * We’re going to setup monitoring so that we are notified more quickly of new bug
   reports / support requests.
 * (It’s manual currently because we usually hear about bugs from our Pro users 
   first – but that didn’t work this time)
 * Great job tracking this down.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Type error: e is undefined’ is closed to new replies.

 * ![](https://ps.w.org/checkoutwc-lite/assets/icon.svg?rev=2819219)
 * [CheckoutWC Lite](https://wordpress.org/plugins/checkoutwc-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/checkoutwc-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/checkoutwc-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/checkoutwc-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/checkoutwc-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/checkoutwc-lite/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Clifton Griffin](https://wordpress.org/support/users/clifgriffin/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/type-error-e-is-undefined/#post-17389105)
 * Status: resolved