Skip to content

TypeError: undefined is not an object on port.close() when listener is active #21

@DavutDurgun

Description

@DavutDurgun

I'm encountering a TypeError: undefined is not an object (evaluating 'window.TAURI_EVENT_PLUGIN_INTERNALS.unregisterListener') when calling port.close() (or port.cancelListen()) after a listener has been set up with port.listen().

If port.close() is called before port.listen(), the error does not occur.

This bug appears to cause serial port listeners to accumulate, leading to multiple receive callbacks for a single incoming message after repeated connect/disconnect cycles.

Environment:

Tauri API: @tauri-apps/api: ^2.5.0

Plugin: tauri-plugin-serialplugin: ^2.12.0

Issue: The plugin's internal listener unregistration seems to fail, resulting in accumulated listeners and an unhandled TypeError during port closure when a listener is active.

Please investigate this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions