p4535992 / foundryvtt-chat-portrait

Other
2 stars 6 forks source link

[BUG] TypeError: Error thrown in hooked function '' for hook 'chatMessage'. map is undefined #47

Open iconmaster5326 opened 3 months ago

iconmaster5326 commented 3 months ago

When I try to use the "speak as" functionality, I get this error, and the chat message just shows up as default, rather than as that actor:

TypeError: Error thrown in hooked function '' for hook 'chatMessage'. map is undefined
[Detected 3 packages: chat-portrait, system:pf2e, lib-wrapper]
    readySpeakAs speak-as.js:36
    #call foundry.js:730
    call foundry.js:712
    processMessage foundry.js:85912
    _onChatKeyDown foundry.js:86228
    jQuery 9
    activateListeners foundry.js:85847
    activateListeners pf2e.mjs:1658
    _render foundry.js:5842
    _render foundry.js:69030
    _render foundry.js:85588
    _render foundry.js:70869
    render foundry.js:5769
    initializeUI foundry.js:8869
    setupGame foundry.js:8725
    _initializeGameView foundry.js:9990
    _initializeView foundry.js:9966
    initialize foundry.js:8650
    call_wrapped libWrapper-wrapper.js:507
    libWrapperInit libWrapper-api.js:805
    initialize#0 libWrapper-wrapper.js:187
    <anonymous> foundry.js:91833
[foundry.js:753:30](https://REDACTED.forge-vtt.com/scripts/foundry.js)
    onError foundry.js:753
    call_wrapped libWrapper-wrapper.js:507
    <anonymous> listeners.js:138
    onError#0 libWrapper-wrapper.js:187
    #call foundry.js:734
    call foundry.js:712
    processMessage foundry.js:85912
    _onChatKeyDown foundry.js:86228
    jQuery 9
    activateListeners foundry.js:85847
    activateListeners pf2e.mjs:1658
    _render foundry.js:5842
    _render foundry.js:69030
    _render foundry.js:85588
    _render foundry.js:70869
    render foundry.js:5769
    initializeUI foundry.js:8869
    setupGame foundry.js:8725
    _initializeGameView foundry.js:9990
    _initializeView foundry.js:9966
    initialize foundry.js:8650
    call_wrapped libWrapper-wrapper.js:507
    libWrapperInit libWrapper-api.js:805
    initialize#0 libWrapper-wrapper.js:187
    <anonymous> foundry.js:91833

This is on the following versions:

image

Attached is my plugin list:

image

iconmaster5326 commented 1 month ago

It works now, but only if there is a token of that character in the active scene. Is this the intended functionality? If so, I'm dissapointed, because I hate the fact that you need to drag in tokens of whoever you need to speak to all the time.