{"action":"created","issue":{"url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/6","repository_url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol","labels_url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/6/comments","events_url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/6/events","html_url":"https://github.com/wojtkowiak/meteor-custom-protocol/issues/6","id":383916236,"node_id":"MDU6SXNzdWUzODM5MTYyMzY=","number":6,"title":"Error: Protocol MyProtocol did not receive unique id. Check if the file name is in format `<name>.protocol.js` so that the indexer can assign an id to it","user":{"login":"Fabbok1x","id":12361221,"node_id":"MDQ6VXNlcjEyMzYxMjIx","avatar_url":"https://avatars3.githubusercontent.com/u/12361221?v=4","gravatar_id":"","url":"https://api.github.com/users/Fabbok1x","html_url":"https://github.com/Fabbok1x","followers_url":"https://api.github.com/users/Fabbok1x/followers","following_url":"https://api.github.com/users/Fabbok1x/following{/other_user}","gists_url":"https://api.github.com/users/Fabbok1x/gists{/gist_id}","starred_url":"https://api.github.com/users/Fabbok1x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fabbok1x/subscriptions","organizations_url":"https://api.github.com/users/Fabbok1x/orgs","repos_url":"https://api.github.com/users/Fabbok1x/repos","events_url":"https://api.github.com/users/Fabbok1x/events{/privacy}","received_events_url":"https://api.github.com/users/Fabbok1x/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-11-23T19:47:38Z","updated_at":"2018-11-28T15:07:25Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\nwhen using this package with Meteor React the this error will occur during build:\r\n`Error: Protocol MyProtocol did not receive unique id. Check if the file name is in format `<name>.protocol.js` so that the indexer can assign an id to it`\r\n\r\nOriginating from /lib/common.js Line 50:\r\n```\r\n        if (!CustomProtocolsIndex[name]) {\r\n            throw new Error(`Protocol ${name} did not receive unique id. Check if the file name is `\r\n                + 'in format `<name>.protocol.js` so that the indexer can assign an id to it.');\r\n        }\r\n```\r\n\r\n\r\nThe folder private exists in the root of the dir, with the file custom_protocols_index.json:\r\n```\r\n\r\n{\r\n    \"JsonProtocol\": {\r\n        \"id\": 1,\r\n        \"package\": \"omega:custom-protocol\"\r\n    },\r\n    \"MyProtocol\": {\r\n        \"id\": 2,\r\n        \"package\": \"app\"\r\n    }\r\n}\r\n```\r\n\r\n\r\nThe protocol exists in /imports/ui , \r\n\r\nMy.protocol.js\r\n```\r\nclass MyProtocol extends CustomProtocol {\r\n    constructor() {\r\n        super();\r\n        this.MY_MESSAGE = 1;\r\n        this._messages[this.MY_MESSAGE] = { /*definition object*/ };\r\n        this.registerProtocol('MyProtocol'); // pass your class name\r\n     }\r\n    encode(messageId, definition, ...payload) {\r\n        return JSON.stringify(payload[0]);\r\n    }\r\n\r\n    decode(messageId, definiton, rawMessage) {\r\n        return JSON.parse(rawMessage);\r\n    }\r\n}\r\n\r\n\r\nexport default  new MyProtocol();\r\n```\r\n\r\n\r\nMy.protocol\r\n[Empty]\r\n\r\nIs there a fix or workarround for this issue?"},"comment":{"url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/comments/442479487","html_url":"https://github.com/wojtkowiak/meteor-custom-protocol/issues/6#issuecomment-442479487","issue_url":"https://api.github.com/repos/wojtkowiak/meteor-custom-protocol/issues/6","id":442479487,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjQ3OTQ4Nw==","user":{"login":"Fabbok1x","id":12361221,"node_id":"MDQ6VXNlcjEyMzYxMjIx","avatar_url":"https://avatars3.githubusercontent.com/u/12361221?v=4","gravatar_id":"","url":"https://api.github.com/users/Fabbok1x","html_url":"https://github.com/Fabbok1x","followers_url":"https://api.github.com/users/Fabbok1x/followers","following_url":"https://api.github.com/users/Fabbok1x/following{/other_user}","gists_url":"https://api.github.com/users/Fabbok1x/gists{/gist_id}","starred_url":"https://api.github.com/users/Fabbok1x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fabbok1x/subscriptions","organizations_url":"https://api.github.com/users/Fabbok1x/orgs","repos_url":"https://api.github.com/users/Fabbok1x/repos","events_url":"https://api.github.com/users/Fabbok1x/events{/privacy}","received_events_url":"https://api.github.com/users/Fabbok1x/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T15:07:25Z","updated_at":"2018-11-28T15:07:25Z","author_association":"NONE","body":"Oh, You mean, it's supposed to work from Server to Client and Client to Server?"}}
{"actor":{"display_login":"Fabbok1x"}}