Skip to content

Create bundle for message-bus-ajax #234

@nic-lan

Description

@nic-lan

I have installed message_bus by doing

yarn add message_bus

and now in my package.json i can see the package version installed "^2.0.3-beta.2"

in the js i do :

MessageBus.subscribe('/channel', (data) => {
    console.log(data);
  })

and in the console when a event is published to the channel i receive the following error:

VM40:2 Uncaught SyntaxError: Unexpected token | in JSON at position 129
    at JSON.parse (<anonymous>)
    at Object.success (message-bus.js:175)
    at XMLHttpRequest.xhr.onreadystatechange

If i understand correctly the issue is generated here

Screen Shot 2020-09-10 at 23 53 18

after some investigation i can see that the issue is message-bus.js:257

  options.success(xhr.responseText);

where

responseText: "[{"global_id":-1,"message_id":-1,"channel":"/__status","data":{"/channel":1}}]
↵|
↵[]
↵|
↵"

which does not look very good to me.

Note

Also the javascript in this repo is different from what i see in the package installed with yarn.

To make a test i just tried to copy-paste the original source of the javascript in the repo and it worked as expected so i guess that the fix here is just release the right version of the javascript client in the npm or wherever is stored

:-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions