Skip to content

Bug Report: Critical Issues in TawkMessenger Component #47

@Onyelaudochukwuka

Description

@Onyelaudochukwuka

Bug Report: Runtime Error in tawkSwitchWidget

Summary

A critical issue was identified in the TawkMessenger component that can cause a runtime error when calling tawkSwitchWidget.

Issue Details

Parameter mismatch in tawkSwitchWidget method

  • Location: useImperativeHandle, line 144
  • Method: tawkSwitchWidget

Current Implementation

tawkSwitchWidget: (options, callback) => {
    window.Tawk_API.switchWidget(data, callback);
}

Problem

The variable data is referenced but never defined within the scope of this method. This results in undefined being passed to switchWidget, causing a runtime error.

Based on the method signature, options is clearly intended to be passed instead.

Expected Behavior

The options parameter should be forwarded to window.Tawk_API.switchWidget.

Suggested Fix

tawkSwitchWidget: (options, callback) => {
    window.Tawk_API.switchWidget(options, callback);
}

Impact

  • Causes runtime errors when tawkSwitchWidget is invoked
  • Breaks widget switching functionality
  • Can crash consumer applications depending on error handling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions